diff options
| author | Yonatan Cohen <yonatanc@mellanox.com> | 2017-11-13 03:51:18 -0500 |
|---|---|---|
| committer | Doug Ledford <dledford@redhat.com> | 2017-11-13 16:59:22 -0500 |
| commit | 87ab3f524efd171699d21bbc98b1268acb476da5 (patch) | |
| tree | b83cc8087a74d346b0b2026cb9927178b3ff463e | |
| parent | 0fd586de65ae6a249433e1b496f5ed9ce199be73 (diff) | |
IB/mlx5: Add CQ moderation capability to query_device
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>
| -rw-r--r-- | drivers/infiniband/hw/mlx5/main.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 5a0ed6a499f4..543d0a4c8bf3 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c | |||
| @@ -790,6 +790,13 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, | |||
| 790 | props->tm_caps.max_sge = MLX5_TM_MAX_SGE; | 790 | props->tm_caps.max_sge = MLX5_TM_MAX_SGE; |
| 791 | } | 791 | } |
| 792 | 792 | ||
| 793 | if (MLX5_CAP_GEN(dev->mdev, cq_moderation)) { | ||
| 794 | props->cq_caps.max_cq_moderation_count = | ||
| 795 | MLX5_MAX_CQ_COUNT; | ||
| 796 | props->cq_caps.max_cq_moderation_period = | ||
| 797 | MLX5_MAX_CQ_PERIOD; | ||
| 798 | } | ||
| 799 | |||
| 793 | if (field_avail(typeof(resp), cqe_comp_caps, uhw->outlen)) { | 800 | if (field_avail(typeof(resp), cqe_comp_caps, uhw->outlen)) { |
| 794 | resp.cqe_comp_caps.max_num = | 801 | resp.cqe_comp_caps.max_num = |
| 795 | MLX5_CAP_GEN(dev->mdev, cqe_compression) ? | 802 | MLX5_CAP_GEN(dev->mdev, cqe_compression) ? |
