]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net/mlx5: LAG, replace peer count check with direct peer lookup
authorShay Drory <shayd@nvidia.com>
Sun, 31 May 2026 11:39:44 +0000 (14:39 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 4 Jun 2026 00:42:20 +0000 (17:42 -0700)
commit2ca494dad9676301ecde1c9e214bfbf83d4c6326
tree211de03c418860b24d4f62f0d2c62b12d798ba94
parent2b1ba02c379f136efadcaad92ade8fa5c3068252
net/mlx5: LAG, replace peer count check with direct peer lookup

Replace mlx5_eswitch_get_npeers() count-based check with a new
mlx5_eswitch_is_peer() function that directly verifies the peer
relationship between two eswitches.

This change prepares for SD LAG support, which is a virtual LAG that
does not have num_lag_ports capability and cannot use the count-based
peer validation.

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/20260531113954.395443-5-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
drivers/net/ethernet/mellanox/mlx5/core/lag/shared_fdb.c