mlxsw: spectrum: Tolerate enslaving of various devices to VRF
authorPetr Machata <petrm@nvidia.com>
Sun, 8 May 2022 08:08:14 +0000 (11:08 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 8 May 2022 10:46:20 +0000 (11:46 +0100)
commit7cf0f96df1d86a4d08ac0160931df85bc88d42e8
tree9829aa1732334d49adaaf78b4391171f5c5d2485
parent9f88af22521db8602c68dc7b38b3b1189a6ec0ba
mlxsw: spectrum: Tolerate enslaving of various devices to VRF

Enslaving netdevices to VRF is currently handled through an
mlxsw_sp_is_vrf_event() conditional in mlxsw_sp_netdevice_event(). In the
following patch sets, VRF enslavement will be handled purely in the router
code. Therefore make handlers of NETDEV_PRECHANGEUPPER tolerant of
enslaving to VRF, so that they do not bounce the change.

For NETDEV_CHANGEUPPER, drop the WARN_ON(1) and bounce from
mlxsw_sp_netdevice_port_vlan_event(). This is the only handler that warned
and bounces even in the CHANGEUPPER code, other handler quietly do nothing
when they encounter an unfamiliar upper.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c