@@ -3994,6 +3994,19 @@ static void mlxsw_sp_port_ovs_leave(struct mlxsw_sp_port *mlxsw_sp_port)
mlxsw_sp_port_vp_mode_set(mlxsw_sp_port, false);
}
+static void mlxsw_sp_port_vlan_leave(struct mlxsw_sp_port *mlxsw_sp_port,
+ struct net_device *vlan_dev)
+{
+ struct net_device *br_dev;
+
+ if (!netif_is_bridge_port(vlan_dev))
+ return;
+
+ br_dev = netdev_master_upper_dev_get(vlan_dev);
+
+ mlxsw_sp_port_bridge_leave(mlxsw_sp_port, vlan_dev, br_dev);
+}
+
static bool mlxsw_sp_bridge_has_multiple_vxlans(struct net_device *br_dev)
{
unsigned int num_vxlans = 0;
@@ -4225,16 +4238,8 @@ 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);
+ } else if (is_vlan_dev(upper_dev) && !info->linking) {
+ mlxsw_sp_port_vlan_leave(mlxsw_sp_port, upper_dev);
}
break;
}