Skip to contentSkip to conversation

RDMA/mlx5: Remove warn on missing representor in query_port_speed

PATCH Applied Edward Srouji 2 participants 2 messages Aug 11 – Sep 1

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/mlx5: Remove warn on missing representor in query_port_speed

From: Or Har-Toov <[email protected]>

The representor ib_device's phys_port_cnt is set to the total vport count when the uplink vport rep loads. Individual port[i].rep entries are populated only as each VF/SF vport rep registers. A NULL .rep for a given port index is therefore expected while VF reps are still loading or haven't been enabled yet.

Tools like ibstat and ibv_devinfo iterate over all ports of all RDMA devices. Some ports may not have an eswitch representor, causing repeated dmesg warnings when these tools run without a device argument. This causes dmesg to be flooded with this message on every ibstat invocation.

Remove the warning and return -ENODEV when no representor exists for the queried port.

Fixes aaecff5e13cd ("RDMA/mlx5: Implement query_port_speed callback")
---
 drivers/infiniband/hw/mlx5/main.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/infiniband/hw/mlx5/main.c +2 -5
index cc7e9a3e76310b626779837e248d399f84f82ec6..906e636c6408590a902bba16caa81b2aab156776 100644
@@ -1682,11 +1682,8 @@ static int mlx5_ib_query_port_speed_rep(struct mlx5_ib_dev *dev, u32 port_num,
 	struct mlx5_core_dev *mdev;
 	u16 op_mod;
 
-	if (!dev->port[port_num - 1].rep) {
-		mlx5_ib_warn(dev, "Representor doesn't exist for port %u\n",
-			     port_num);
-		return -EINVAL;
-	}
+	if (!dev->port[port_num - 1].rep)
+		return -ENODEV;
 
 	rep = dev->port[port_num - 1].rep;
 	mdev = mlx5_eswitch_get_core_dev(rep->esw);

---
base-commit: a12d9145145b21c50531afb6e3f711b1f34e1465
change-id: 20260811-remove-warn-on-miss-rep-df03a4050e0d

Best regards,

Signature · 1 line
Edward Srouji <[email protected]>
#1 lore raw
Quoted 6 lines · Edward Srouji

The representor ib_device's phys_port_cnt is set to the total vport count when the uplink vport rep loads. Individual port[i].rep entries are populated only as each VF/SF vport rep registers. A NULL .rep for a given port index is therefore expected while VF reps are still loading or haven't been enabled yet.

Quoted 7 lines

Tools like ibstat and ibv_devinfo iterate over all ports of all RDMA devices. Some ports may not have an eswitch representor, causing repeated dmesg warnings when these tools run without a device argument. This causes dmesg to be flooded with this message on every ibstat invocation.

[...]

Applied, thanks!

[1/1] RDMA/mlx5: Remove warn on missing representor in query_port_speed

      https://git.kernel.org/rdma/rdma/c/2be77295316c2d

Best regards,

Signature · 1 line
Leon Romanovsky <[email protected]>