]> www.infradead.org Git - users/hch/misc.git/commit
RDMA/mlx5: Ensure active slave attachment to the bond IB device
authorChiara Meiohas <cmeiohas@nvidia.com>
Thu, 31 Oct 2024 13:36:52 +0000 (15:36 +0200)
committerLeon Romanovsky <leon@kernel.org>
Mon, 4 Nov 2024 11:57:21 +0000 (06:57 -0500)
commit0bd2c61df95321e1ec123017cd8657360d15a24e
tree6740cf5257e9cc7e1b1d2be5fe375d41f9930d59
parentaf7a35bf6c36a77624d3abe46b3830b7c2a5f20c
RDMA/mlx5: Ensure active slave attachment to the bond IB device

Fix a race condition when creating a lag bond in active backup
mode where after the bond creation the backup slave was
attached to the IB device, instead of the active slave.
This caused stale entries in the GID table, as the gid updating
mechanism relies on ib_device_get_netdev(), which would return
the backup slave.

Send an MLX5_DRIVER_EVENT_ACTIVE_BACKUP_LAG_CHANGE_LOWERSTATE
event when activating the lag, additionally to when modifying
the lag. This ensures that eventually the active netdevice is
stored in the bond IB device.
When handling this event remove the GIDs of the previously
attached netdevice in this port and rescan the GIDs of the
newly attached netdevice.

This ensures that eventually the active slave netdevice is
correctly stored in the IB device port. While there might be
a brief moment where the backup slave GIDs appear in the GID
table, it will eventually stabilize with the correct GIDs
(of the bond and the active slave).

Fixes: 8d159eb2117b ("RDMA/mlx5: Use IB set_netdev and get_netdev functions")
Signed-off-by: Chiara Meiohas <cmeiohas@nvidia.com>
Link: https://patch.msgid.link/91fc2cb24f63add266a528c1c702668a80416d9f.1730381292.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/mlx5/main.c
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c