diff options
author | Ido Schimmel <idosch@mellanox.com> | 2016-06-20 21:04:01 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-21 09:02:48 (GMT) |
commit | 6ec439043b0dcbd7845b9e268a12daac92ebd190 (patch) | |
tree | 5c66ef8fcfd8a3aa0634a8a7c116121523e66e2d /drivers/net/ethernet | |
parent | 59fe9b3f842751688d9ee180f673314190813be1 (diff) | |
download | linux-6ec439043b0dcbd7845b9e268a12daac92ebd190.tar.xz |
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: 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')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c index b47e3fb..46c867f 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c @@ -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; |