Skip to content

Commit

Permalink
mlxsw: spectrum: Handle VLAN device unlinking
Browse files Browse the repository at this point in the history
In commit 993107f ("mlxsw: spectrum_switchdev: Fix VLAN device
deletion via ioctl") I fixed a bug caused by the fact that the driver
views differently the deletion of a VLAN device when it is deleted via
an ioctl and netlink.

Instead of relying on a specific order of events (device being
unregistered vs. VLAN filter being updated), simply make sure that the
driver performs the necessary cleanup when the VLAN device is unlinked,
which always happens before the other two events.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ido Schimmel authored and David S. Miller committed Dec 19, 2018
1 parent f1d7c33 commit e149113
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/net/ethernet/mellanox/mlxsw/spectrum.c
Original file line number Diff line number Diff line change
Expand Up @@ -5000,6 +5000,16 @@ static int mlxsw_sp_netdevice_port_upper_event(struct net_device *lower_dev,
} else if (netif_is_macvlan(upper_dev)) {
if (!info->linking)
mlxsw_sp_rif_macvlan_del(mlxsw_sp, upper_dev);
} else if (is_vlan_dev(upper_dev)) {
struct net_device *br_dev;

if (!netif_is_bridge_port(upper_dev))
break;
if (info->linking)
break;
br_dev = netdev_master_upper_dev_get(upper_dev);
mlxsw_sp_port_bridge_leave(mlxsw_sp_port, upper_dev,
br_dev);
}
break;
}
Expand Down

0 comments on commit e149113

Please sign in to comment.