IB/mlx5: Add CQ moderation capability to query_device
authorYonatan Cohen <yonatanc@mellanox.com>
Mon, 13 Nov 2017 08:51:18 +0000 (10:51 +0200)
committerDoug Ledford <dledford@redhat.com>
Mon, 13 Nov 2017 21:59:22 +0000 (16:59 -0500)
query_device can now obtain the maximum values for
cq_max_count and cq_period, needed for cq moderation.

Signed-off-by: Yonatan Cohen <yonatanc@mellanox.com>
Reviewed-by: Majd Dibbiny <majd@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/mlx5/main.c

index 5a0ed6a499f42ef2ea34ef084963a9c3e9b3724f..543d0a4c8bf36eb43af6d9047c7eaa6cd75d9638 100644 (file)
@@ -790,6 +790,13 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
                props->tm_caps.max_sge = MLX5_TM_MAX_SGE;
        }
 
+       if (MLX5_CAP_GEN(dev->mdev, cq_moderation)) {
+               props->cq_caps.max_cq_moderation_count =
+                                               MLX5_MAX_CQ_COUNT;
+               props->cq_caps.max_cq_moderation_period =
+                                               MLX5_MAX_CQ_PERIOD;
+       }
+
        if (field_avail(typeof(resp), cqe_comp_caps, uhw->outlen)) {
                resp.cqe_comp_caps.max_num =
                        MLX5_CAP_GEN(dev->mdev, cqe_compression) ?