net/mlx5: Lag, Create shared FDB when in switchdev mode
authorMark Bloch <mbloch@nvidia.com>
Tue, 3 Aug 2021 23:19:59 +0000 (16:19 -0700)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 5 Aug 2021 20:50:52 +0000 (13:50 -0700)
commit598fe77df855feeeca9dfda2ffe622ac7724e5c3
treea95bc9ed4fcdf4d5005438d990ad52ef75e188f9
parentdb202995f5035f13a11df48a0af05edbb3720659
net/mlx5: Lag, Create shared FDB when in switchdev mode

If both eswitches are in switchdev mode and the uplink representors
are enslaved to the same bond device create a shared FDB configuration.

When moving to shared FDB mode not only the hardware needs be configured
but the RDMA driver needs to reconfigure itself.

When such change is done, unload the RDMA devices, configure the hardware
and load the RDMA representors.

When destroying the lag (can happen if a PCI function is unbinded,
driver is unloaded or by just removing a netdev from the bond) make sure
to restore the system to the previous state only if possible.

For example, if a PCI function is unbinded there is no need to load the
representors as the device is going away.

Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/lag.c
drivers/net/ethernet/mellanox/mlx5/core/lag.h
drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c