Linux-RDMA Archive mirror
 help / color / mirror / Atom feed
* [PATCH rdma-rc] RDMA/mlx5: Fix port number for counter query in multi-port configuration
@ 2024-04-03  9:03 Leon Romanovsky
  2024-04-08 10:33 ` Leon Romanovsky
  0 siblings, 1 reply; 2+ messages in thread
From: Leon Romanovsky @ 2024-04-03  9:03 UTC (permalink / raw
  To: Jason Gunthorpe; +Cc: Michael Guralnik, Chris Mi, linux-rdma, Mark Bloch

From: Michael Guralnik <michaelgur@nvidia.com>

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>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
 drivers/infiniband/hw/mlx5/mad.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/mlx5/mad.c b/drivers/infiniband/hw/mlx5/mad.c
index 0c3c4e64812c..3e43687a7f6f 100644
--- a/drivers/infiniband/hw/mlx5/mad.c
+++ b/drivers/infiniband/hw/mlx5/mad.c
@@ -188,7 +188,8 @@ static int process_pma_cmd(struct mlx5_ib_dev *dev, u32 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;
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH rdma-rc] RDMA/mlx5: Fix port number for counter query in multi-port configuration
  2024-04-03  9:03 [PATCH rdma-rc] RDMA/mlx5: Fix port number for counter query in multi-port configuration Leon Romanovsky
@ 2024-04-08 10:33 ` Leon Romanovsky
  0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2024-04-08 10:33 UTC (permalink / raw
  To: Jason Gunthorpe, Leon Romanovsky
  Cc: Michael Guralnik, Chris Mi, linux-rdma, Mark Bloch


On Wed, 03 Apr 2024 12:03:46 +0300, Leon Romanovsky wrote:
> 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.
> 
> 

Applied, thanks!

[1/1] RDMA/mlx5: Fix port number for counter query in multi-port configuration
      https://git.kernel.org/rdma/rdma/c/be121ffb384f53

Best regards,
-- 
Leon Romanovsky <leon@kernel.org>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-08 10:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-03  9:03 [PATCH rdma-rc] RDMA/mlx5: Fix port number for counter query in multi-port configuration Leon Romanovsky
2024-04-08 10:33 ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).