mlxsw: spectrum_router: Replay IP NETDEV_UP on device deslavement
authorPetr Machata <petrm@nvidia.com>
Wed, 19 Jul 2023 11:01:31 +0000 (13:01 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 Jul 2023 07:54:06 +0000 (08:54 +0100)
commit4560cf408ecae4824a2bbdcef83cf91b2db5d268
tree9ec84daf7b7f12ae69c58c4ee3670173a3b6c2cd
parent31618b22f2c4c0a4491554a2d879141efdffe88f
mlxsw: spectrum_router: Replay IP NETDEV_UP on device deslavement

When a netdevice is removed from a bridge or a LAG, and it has an IP
address, it should join the router and gain a RIF. Do that by replaying
address addition event on the netdevice.

When handling deslavement of LAG or its upper from a bridge device, the
replay should be done after all the lowers of the LAG have left the bridge.
Thus these scenarios are handled by passing replay_deslavement of false,
and by invoking, after the lowers have been processed, a new helper,
mlxsw_sp_netdevice_post_lag_event(), which does the per-LAG / -upper
handling, and in particular invokes the replay.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Danielle Ratson <danieller@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h