diff mbox series

[rdma-next] RDMA/mlx5: Support querying per-plane IB PortCounters

Message ID 828d57444a0a41042556bb0a4394ecf2fcaed639.1730368052.git.leon@kernel.org (mailing list archive)
State Accepted
Headers show
Series [rdma-next] RDMA/mlx5: Support querying per-plane IB PortCounters | expand

Commit Message

Leon Romanovsky Oct. 31, 2024, 9:48 a.m. UTC
From: Mark Zhang <markzhang@nvidia.com>

On a SMI device, set requested plane_num when querying PPCNT register
with the PortCounters Attribute group.

Signed-off-by: Mark Zhang <markzhang@nvidia.com>
Reviewed-by: Maher Sanalla <msanalla@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
 drivers/infiniband/hw/mlx5/mad.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Leon Romanovsky Nov. 4, 2024, 8:39 a.m. UTC | #1
On Thu, 31 Oct 2024 11:48:14 +0200, Leon Romanovsky wrote:
> On a SMI device, set requested plane_num when querying PPCNT register
> with the PortCounters Attribute group.
> 
> 

Applied, thanks!

[1/1] RDMA/mlx5: Support querying per-plane IB PortCounters
      https://git.kernel.org/rdma/rdma/c/af58db354865a4

Best regards,
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/mlx5/mad.c b/drivers/infiniband/hw/mlx5/mad.c
index 1b6c5e37d169..2453ae4384a7 100644
--- a/drivers/infiniband/hw/mlx5/mad.c
+++ b/drivers/infiniband/hw/mlx5/mad.c
@@ -278,7 +278,13 @@  static int process_pma_cmd(struct mlx5_ib_dev *dev, u32 port_num,
 			goto done;
 		}
 
-		err = query_ib_ppcnt(mdev, mdev_port_num, 0, out_cnt, sz, 0);
+		if (dev->ib_dev.type == RDMA_DEVICE_TYPE_SMI)
+			err = query_ib_ppcnt(mdev, mdev_port_num, port_num,
+					     out_cnt, sz, 0);
+		else
+			err = query_ib_ppcnt(mdev, mdev_port_num, 0,
+					     out_cnt, sz, 0);
+
 		if (!err)
 			pma_cnt_assign(pma_cnt, out_cnt);
 	}