]> git.ipfire.org Git - thirdparty/linux.git/commit
net/mlx5: LAG, use xa_alloc to manage LAG device indices
authorShay Drory <shayd@nvidia.com>
Mon, 9 Mar 2026 09:34:30 +0000 (11:34 +0200)
committerLeon Romanovsky <leon@kernel.org>
Mon, 16 Mar 2026 20:23:00 +0000 (16:23 -0400)
commit2b204cdb12068c7087f44a6a6d0af6f71fd72237
tree478af3f70a13f3076bcbdccb573293143e04452e
parent91e9f3e7b626579b0393151545b80e50e2bffdca
net/mlx5: LAG, use xa_alloc to manage LAG device indices

Replace the use of mlx5_get_dev_index() for xarray indexing with
xa_alloc() to dynamically allocate indices. This decouples the LAG
xarray index from the physical device index.

Update mlx5_ldev_add_netdev/remove_mdev to find entries by dev pointer
and replace mlx5_lag_get_dev_index_by_seq(ldev, MLX5_LAG_P1) calls with
mlx5_lag_get_master_idx() where appropriate.

No functional changes intended

Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260309093435.1850724-5-tariqt@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.h
drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c
drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c