]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mlxsw: spectrum: Store pointer to default port VLAN in port struct
authorIdo Schimmel <idosch@mellanox.com>
Thu, 20 Dec 2018 19:42:30 +0000 (19:42 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Dec 2018 23:48:54 +0000 (15:48 -0800)
Subsequent patches will need to access the default port VLAN. Since this
VLAN will exist throughout the lifetime of the port, simply store it in
the port's struct.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum.h

index c212e803a381233cfa5b4eb0261caf0632aa5f07..d74b254a6c52c8128c0e8d7cb6e90386dba0fc2d 100644 (file)
@@ -3201,6 +3201,7 @@ static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u8 local_port,
                err = PTR_ERR(mlxsw_sp_port_vlan);
                goto err_port_vlan_create;
        }
+       mlxsw_sp_port->default_vlan = mlxsw_sp_port_vlan;
 
        mlxsw_sp_port_switchdev_init(mlxsw_sp_port);
        mlxsw_sp->ports[local_port] = mlxsw_sp_port;
index a669aed690cbfeb68b3b83f20cd97603c3d1818a..4e11915d676add9e9d09491b314a71f481d06147 100644 (file)
@@ -242,6 +242,7 @@ struct mlxsw_sp_port {
        } periodic_hw_stats;
        struct mlxsw_sp_port_sample *sample;
        struct list_head vlans_list;
+       struct mlxsw_sp_port_vlan *default_vlan;
        struct mlxsw_sp_qdisc *root_qdisc;
        struct mlxsw_sp_qdisc *tclass_qdiscs;
        unsigned acl_rule_count;