Skip to content

Commit e149113

Browse files
idoschdavem330
authored andcommitted
mlxsw: spectrum: Handle VLAN device unlinking
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 <[email protected]> Reviewed-by: Petr Machata <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f1d7c33 commit e149113

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/net/ethernet/mellanox/mlxsw/spectrum.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5000,6 +5000,16 @@ static int mlxsw_sp_netdevice_port_upper_event(struct net_device *lower_dev,
50005000
} else if (netif_is_macvlan(upper_dev)) {
50015001
if (!info->linking)
50025002
mlxsw_sp_rif_macvlan_del(mlxsw_sp, upper_dev);
5003+
} else if (is_vlan_dev(upper_dev)) {
5004+
struct net_device *br_dev;
5005+
5006+
if (!netif_is_bridge_port(upper_dev))
5007+
break;
5008+
if (info->linking)
5009+
break;
5010+
br_dev = netdev_master_upper_dev_get(upper_dev);
5011+
mlxsw_sp_port_bridge_leave(mlxsw_sp_port, upper_dev,
5012+
br_dev);
50035013
}
50045014
break;
50055015
}

0 commit comments

Comments
 (0)