diff options
author | Michael Guralnik <michaelgur@nvidia.com> | 2024-04-03 12:03:46 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-05-02 16:17:09 +0200 |
commit | 4d0f5f7f583875236ccc649825cdc7cdadccd1f9 (patch) | |
tree | a8da285bb591125acf22837975d73a1da1fe7a6c | |
parent | 68459b8e3ee554ce71878af9eb69659b9462c588 (diff) | |
download | linux-stable-4d0f5f7f583875236ccc649825cdc7cdadccd1f9.tar.gz linux-stable-4d0f5f7f583875236ccc649825cdc7cdadccd1f9.tar.bz2 linux-stable-4d0f5f7f583875236ccc649825cdc7cdadccd1f9.zip |
RDMA/mlx5: Fix port number for counter query in multi-port configuration
[ Upstream commit be121ffb384f53e966ee7299ffccc6eeb61bc73d ]
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: 74b30b3ad5ce ("RDMA/mlx5: Set local port to one when accessing counters")
Signed-off-by: Michael Guralnik <michaelgur@nvidia.com>
Link: https://lore.kernel.org/r/9bfcc8ade958b760a51408c3ad654a01b11f7d76.1712134988.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/infiniband/hw/mlx5/mad.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx5/mad.c b/drivers/infiniband/hw/mlx5/mad.c index fb6dcd12db25..a7b20db03901 100644 --- a/drivers/infiniband/hw/mlx5/mad.c +++ b/drivers/infiniband/hw/mlx5/mad.c @@ -216,7 +216,8 @@ static int process_pma_cmd(struct mlx5_ib_dev *dev, u8 port_num, mdev = dev->mdev; mdev_port_num = 1; } - if (MLX5_CAP_GEN(dev->mdev, num_ports) == 1) { + if (MLX5_CAP_GEN(dev->mdev, num_ports) == 1 && + !mlx5_core_mp_enabled(mdev)) { /* set local port to one for Function-Per-Port HCA. */ mdev = dev->mdev; mdev_port_num = 1; |