summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2017-05-26 08:37:28 +0200
committerDavid S. Miller <davem@davemloft.net>2017-05-26 15:18:45 -0400
commit7cbecf245ade1739f34e00a10b2cdedd851bd7f4 (patch)
treeb06e93be60af1cf33a827ad9a1b90bd7084fd1ed /drivers/net/ethernet/mellanox/mlxsw/spectrum.c
parentce95e1545681dd73fa73ac12a06135c4fcdb47cc (diff)
downloadlwn-7cbecf245ade1739f34e00a10b2cdedd851bd7f4.tar.gz
lwn-7cbecf245ade1739f34e00a10b2cdedd851bd7f4.zip
mlxsw: spectrum_router: Replace vPorts with Port-VLAN
We're going to get rid of vPorts completely later in the patchset, but the router code is self-contained, so it's a good candidate to start the transition with. Convert all the functions that expects to operate on a vPort to operate on a Port-VLAN instead. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/spectrum.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index acc3a1a76d1b..e04d2ed34d7e 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -1499,6 +1499,10 @@ mlxsw_sp_port_vlan_create(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid)
static void
mlxsw_sp_port_vlan_destroy(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan)
{
+ struct mlxsw_sp_fid *fid = mlxsw_sp_port_vlan->fid;
+
+ if (fid && !WARN_ON(!fid->leave))
+ fid->leave(mlxsw_sp_port_vlan);
list_del(&mlxsw_sp_port_vlan->list);
kfree(mlxsw_sp_port_vlan);
}