[PATCH rdma-next 16/16] IB/mlx5: Expose max_counter_sets capability

Yishai Hadas
2017-10-19T14:41:58Z

From: Raed Salem <raeds-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

max_counter_sets represents the number of different counter sets
exposed and makes the upper limit for the counter set id provided
to describe/create counter sets verbs i.e. counter set id must be
in range [0, max_counter_sets - 1].

Counter set id will be used with counter set object in downstream patches.

Signed-off-by: Raed Salem <raeds-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Reviewed-by: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
drivers/infiniband/hw/mlx5/main.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 46ac67b..499d694 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -601,6 +601,9 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
return -EINVAL;

memset(props, 0, sizeof(*props));
+ props->max_counter_sets =
+ dev->counter_sets.max_counter_sets;
+
err = mlx5_query_system_image_guid(ibdev,
&props->sys_image_guid);
if (err)
--
1.8.3.1