Skip to content

Commit 0d10899

Browse files
PatrisiousHaddadvijay-suman
authored andcommitted
RDMA/mlx5: Fix CC counters query for MPV
In case you are querying CC counters for the second port use the correct core device for the query instead of always using the master core device. Orabug: 38014918 Note: This is an out-of-tree patch that will be replaced with the upstream version once it becomes available. Nvidia is currently in the process of upstreaming it. Signed-off-by: Patrisious Haddad <[email protected]> Signed-off-by: Qing Huang <[email protected]> Tested-by: Partha Tirumalai <[email protected]> Tested-by: Mamta Gambhir <[email protected]> Reviewed-by: Konrad Rzeszutek Wilk <[email protected]> Signed-off-by: Vijayendra Suman <[email protected]>
1 parent 283fca4 commit 0d10899

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/infiniband/hw/mlx5/counters.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,11 @@ static int do_get_hw_stats(struct ib_device *ibdev,
431431
return ret;
432432

433433
/* We don't expose device counters over Vports */
434+
#ifdef WITHOUT_ORACLE_EXTENSIONS
434435
if (is_mdev_switchdev_mode(dev->mdev) && port_num != 0)
436+
#else
437+
if (is_mdev_switchdev_mode(dev->mdev) && dev->is_rep && port_num != 0)
438+
#endif /* !WITHOUT_ORACLE_EXTENSIONS */
435439
goto done;
436440

437441
if (MLX5_CAP_PCAM_FEATURE(dev->mdev, rx_icrc_encapsulated_counter)) {
@@ -451,7 +455,11 @@ static int do_get_hw_stats(struct ib_device *ibdev,
451455
*/
452456
goto done;
453457
}
458+
#ifdef WITHOUT_ORACLE_EXTENSIONS
454459
ret = mlx5_lag_query_cong_counters(dev->mdev,
460+
#else
461+
ret = mlx5_lag_query_cong_counters(mdev,
462+
#endif /* !WITHOUT_ORACLE_EXTENSIONS */
455463
stats->value +
456464
cnts->num_q_counters,
457465
cnts->num_cong_counters,

0 commit comments

Comments
 (0)