提交 6ec43904 编写于 作者: I Ido Schimmel 提交者: David S. Miller

mlxsw: spectrum: Forbid LAG slave from having VLAN uppers

When a port netdev is put under LAG it cannot have VLAN upper devices,
so forbid that. The LAG device itself can have VLAN upper devices.
Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
Signed-off-by: NJiri Pirko <jiri@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 59fe9b3f
......@@ -3038,7 +3038,7 @@ static int mlxsw_sp_netdevice_port_upper_event(struct net_device *dev,
!netif_is_lag_master(upper_dev) &&
!netif_is_bridge_master(upper_dev))
return -EINVAL;
if (!info->master || !info->linking)
if (!info->linking)
break;
/* HW limitation forbids to put ports to multiple bridges. */
if (netif_is_bridge_master(upper_dev) &&
......@@ -3048,6 +3048,11 @@ static int mlxsw_sp_netdevice_port_upper_event(struct net_device *dev,
!mlxsw_sp_master_lag_check(mlxsw_sp, upper_dev,
info->upper_info))
return -EINVAL;
if (netif_is_lag_master(upper_dev) && vlan_uses_dev(dev))
return -EINVAL;
if (netif_is_lag_port(dev) && is_vlan_dev(upper_dev) &&
!netif_is_lag_master(vlan_dev_real_dev(upper_dev)))
return -EINVAL;
break;
case NETDEV_CHANGEUPPER:
upper_dev = info->upper_dev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册