Skip to content

Commit be121ff

Browse files
mikijoyrleon
authored andcommitted
RDMA/mlx5: Fix port number for counter query in multi-port configuration
Set the correct port when querying PPCNT in multi-port configuration. Distinguish between cases where switchdev mode was enabled to multi-port configuration and don't overwrite the queried port to 1 in multi-port case. Fixes: 74b30b3 ("RDMA/mlx5: Set local port to one when accessing counters") Signed-off-by: Michael Guralnik <[email protected]> Link: https://lore.kernel.org/r/9bfcc8ade958b760a51408c3ad654a01b11f7d76.1712134988.git.leon@kernel.org Signed-off-by: Leon Romanovsky <[email protected]>
1 parent b68e1ac commit be121ff

File tree

1 file changed

+2
-1
lines changed
  • drivers/infiniband/hw/mlx5

1 file changed

+2
-1
lines changed

drivers/infiniband/hw/mlx5/mad.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ static int process_pma_cmd(struct mlx5_ib_dev *dev, u32 port_num,
188188
mdev = dev->mdev;
189189
mdev_port_num = 1;
190190
}
191-
if (MLX5_CAP_GEN(dev->mdev, num_ports) == 1) {
191+
if (MLX5_CAP_GEN(dev->mdev, num_ports) == 1 &&
192+
!mlx5_core_mp_enabled(mdev)) {
192193
/* set local port to one for Function-Per-Port HCA. */
193194
mdev = dev->mdev;
194195
mdev_port_num = 1;

0 commit comments

Comments
 (0)