From 0087470661f6a105013ba3ee8e12273703a5b714 Mon Sep 17 00:00:00 2001 From: Michael Gur Date: Thu, 23 Jul 2026 18:15:14 +0300 Subject: [PATCH] RDMA/mlx5: Expose RoCE acceleration counters on all functions Decouple RoCE acceleration counters exposure from the roce_accl device cap. The device cap is intended to protect the access to the roce_accl register and was disabled on VFs for that purpose. Reading the acceleration counters, however, does not involve that register, the counters are read-only statistics that carry no configuration risk. Gating their exposure on the capability therefore needlessly hides useful diagnostic data on VFs. Expose the counters on all functions regardless of the capability. Signed-off-by: Michael Gur Reviewed-by: Chiara Meiohas Signed-off-by: Edward Srouji Link: https://patch.msgid.link/20260723-expose-roce-accl-counters-v1-1-967618b550cd@nvidia.com Signed-off-by: Leon Romanovsky --- drivers/infiniband/hw/mlx5/counters.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/counters.c b/drivers/infiniband/hw/mlx5/counters.c index 5a79e834ddea..2250b195571c 100644 --- a/drivers/infiniband/hw/mlx5/counters.c +++ b/drivers/infiniband/hw/mlx5/counters.c @@ -742,11 +742,9 @@ static void mlx5_ib_fill_counters(struct mlx5_ib_dev *dev, names = is_vport ? vport_roce_accl_cnts : roce_accl_cnts; size = is_vport ? ARRAY_SIZE(vport_roce_accl_cnts) : ARRAY_SIZE(roce_accl_cnts); - if (MLX5_CAP_GEN(dev->mdev, roce_accl)) { - for (i = 0; i < size; i++, j++) { - descs[j].name = names[i].name; - offsets[j] = names[i].offset; - } + for (i = 0; i < size; i++, j++) { + descs[j].name = names[i].name; + offsets[j] = names[i].offset; } if (is_vport) @@ -826,8 +824,7 @@ static int __mlx5_ib_alloc_counters(struct mlx5_ib_dev *dev, size = is_vport ? ARRAY_SIZE(vport_roce_accl_cnts) : ARRAY_SIZE(roce_accl_cnts); - if (MLX5_CAP_GEN(dev->mdev, roce_accl)) - num_counters += size; + num_counters += size; cnts->num_q_counters = num_counters;