IB/mlx4: Add CQ moderation capability to query_device
authorYonatan Cohen <yonatanc@mellanox.com>
Mon, 13 Nov 2017 08:51:17 +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/mlx4/main.c

index 28c10ff..8c8a167 100644 (file)
@@ -563,6 +563,9 @@ static int mlx4_ib_query_device(struct ib_device *ibdev,
                props->max_wq_type_rq = props->max_qp;
        }
 
+       props->cq_caps.max_cq_moderation_count = MLX4_MAX_CQ_COUNT;
+       props->cq_caps.max_cq_moderation_period = MLX4_MAX_CQ_PERIOD;
+
        if (!mlx4_is_slave(dev->dev))
                err = mlx4_get_internal_clock_params(dev->dev, &clock_params);