]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net/mlx5: LAG, replace mlx5_get_dev_index with LAG sequence number
authorShay Drory <shayd@nvidia.com>
Mon, 9 Mar 2026 09:34:32 +0000 (11:34 +0200)
committerLeon Romanovsky <leon@kernel.org>
Mon, 16 Mar 2026 20:23:00 +0000 (16:23 -0400)
commit971b28accc09436fe6a6d5afd667dcbfb3ed7e03
tree63f539a776e751819088b8a09786dc5626ca7b2a
parentda0349d0ffc7b831a589b1fcec59d9d94aa10e55
net/mlx5: LAG, replace mlx5_get_dev_index with LAG sequence number

Introduce mlx5_lag_get_dev_seq() which returns a device's sequence
number within the LAG: master is always 0, remaining devices numbered
sequentially. This provides a stable index for peer flow tracking and
vport ordering without depending on native_port_num.

Replace mlx5_get_dev_index() usage in en_tc.c (peer flow array
indexing) and ib_rep.c (vport index ordering) with the new API.

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-7-tariqt@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/mlx5/ib_rep.c
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c
include/linux/mlx5/lag.h [new file with mode: 0644]