OSDN Git Service

mlxsw: spectrum: Add a replay_deslavement argument to event handlers
authorPetr Machata <petrm@nvidia.com>
Wed, 19 Jul 2023 11:01:23 +0000 (13:01 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 Jul 2023 07:54:04 +0000 (08:54 +0100)
commit1c47e65b8c0ba018152beb13f28afe50017438e4
tree32f6c4f6f636eb3c0126e239a3a392b1f6da1e89
parent40b7b4236c1f8e31d7608ecdae07d3889d5e95a0
mlxsw: spectrum: Add a replay_deslavement argument to event handlers

When handling deslavement of LAG or its upper from a bridge device, when
the deslaved netdevice has an IP address, it should join the router. This
should be done after all the lowers of the LAG have left the bridge. The
replay intended to cause the device to join the router therefore cannot be
invoked unconditionally in the event handlers themselves. It can be done
right away if the handler is invoked for a sole device, but when it is
invoked repeated for each LAG lower, the replay needs to be postponed
until after this processing is done.

To that end, add a boolean parameter, replay_deslavement, to
mlxsw_sp_netdevice_port_upper_event(), mlxsw_sp_netdevice_port_vlan_event()
and one helper on the call path. Have the invocations that are done for
sole netdevices pass true, and those done for LAG lowers pass false.

Nothing depends on this flag at this point, but it removes some noise from
the patch that introduces the replay itself.

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