]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net/mlx5: E-switch, modify peer miss rule index to vhca_id
authorShay Drory <shayd@nvidia.com>
Mon, 9 Mar 2026 09:34:31 +0000 (11:34 +0200)
committerLeon Romanovsky <leon@kernel.org>
Mon, 16 Mar 2026 20:23:00 +0000 (16:23 -0400)
commitda0349d0ffc7b831a589b1fcec59d9d94aa10e55
treef74802a49db0869ec68f1f3fc30749bf22da6fa7
parent2b204cdb12068c7087f44a6a6d0af6f71fd72237
net/mlx5: E-switch, modify peer miss rule index to vhca_id

Replace the fixed-size array peer_miss_rules[MLX5_MAX_PORTS], indexed
by physical function index, with an xarray indexed by vhca_id.

This decouples peer_miss_rules from mlx5_get_dev_index(), removing the
dependency on a PF-derived index and the arbitrary MLX5_MAX_PORTS bounds
check. Using vhca_id as the key simplifies insertion/removal logic and
scales better across multi-peer topologies.

Initialize and destroy the xarray alongside the existing esw->paired
xarray in mlx5_esw_offloads_devcom_init/cleanup respectively.

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-6-tariqt@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c