aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw
diff options
context:
space:
mode:
authorSindhu-Devale <sindhu.devale@intel.com>2022-09-06 17:32:40 -0500
committerLeon Romanovsky <leon@kernel.org>2022-09-07 11:22:17 +0300
commit12faad5e5cf2372af2d51f348b697b5edf838daf (patch)
tree1f8b30e33cad5fe421d36e46552a19841fe7496a /drivers/infiniband/hw
parentMAINTAINERS: Update maintainers of HiSilicon RoCE (diff)
downloadlinux-dev-12faad5e5cf2372af2d51f348b697b5edf838daf.tar.xz
linux-dev-12faad5e5cf2372af2d51f348b697b5edf838daf.zip
RDMA/irdma: Report the correct max cqes from query device
Report the correct max cqes available to an application taking into account a reserved entry to detect overflow. Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs") Signed-off-by: Sindhu-Devale <sindhu.devale@intel.com> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Link: https://lore.kernel.org/r/20220906223244.1119-2-shiraz.saleem@intel.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r--drivers/infiniband/hw/irdma/verbs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
index 9b07b8af2997..f272a323d065 100644
--- a/drivers/infiniband/hw/irdma/verbs.c
+++ b/drivers/infiniband/hw/irdma/verbs.c
@@ -39,7 +39,7 @@ static int irdma_query_device(struct ib_device *ibdev,
props->max_send_sge = hw_attrs->uk_attrs.max_hw_wq_frags;
props->max_recv_sge = hw_attrs->uk_attrs.max_hw_wq_frags;
props->max_cq = rf->max_cq - rf->used_cqs;
- props->max_cqe = rf->max_cqe;
+ props->max_cqe = rf->max_cqe - 1;
props->max_mr = rf->max_mr - rf->used_mrs;
props->max_mw = props->max_mr;
props->max_pd = rf->max_pd - rf->used_pds;