Skip to content

Commit 3cc1dbf

Browse files
PatrisiousHaddadrleon
authored andcommitted
RDMA/mlx5: Fix HW counters query for non-representor devices
To get the device HW counters, a non-representor switchdev device should use the mlx5_ib_query_q_counters() function and query all of the available counters. While a representor device in switchdev mode should use the mlx5_ib_query_q_counters_vport() function and query only the Q_Counters without the PPCNT counters and congestion control counters, since they aren't relevant for a representor device. Currently a non-representor switchdev device skips querying the PPCNT counters and congestion control counters, leaving them unupdated. Fix that by properly querying those counters for non-representor devices. Fixes: d22467a ("RDMA/mlx5: Expand switchdev Q-counters to expose representor statistics") Signed-off-by: Patrisious Haddad <[email protected]> Reviewed-by: Maher Sanalla <[email protected]> Link: https://patch.msgid.link/56bf8af4ca8c58e3fb9f7e47b1dca2009eeeed81.1750064969.git.leon@kernel.org Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 3f5f632 commit 3cc1dbf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/infiniband/hw/mlx5/counters.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ static int do_get_hw_stats(struct ib_device *ibdev,
398398
return ret;
399399

400400
/* We don't expose device counters over Vports */
401-
if (is_mdev_switchdev_mode(dev->mdev) && port_num != 0)
401+
if (is_mdev_switchdev_mode(dev->mdev) && dev->is_rep && port_num != 0)
402402
goto done;
403403

404404
if (MLX5_CAP_PCAM_FEATURE(dev->mdev, rx_icrc_encapsulated_counter)) {

0 commit comments

Comments
 (0)