Skip to content

Commit 6cd8351

Browse files
hz-chengrleon
authored andcommitted
RDMA/erdma: Correct the max_qp and max_cq capacities of the device
QP0 in HW is used for CMDQ, and the rest is for RDMA QPs. So the actual max_qp capacity reported to core should be max_qp (reported by HW) - 1. So does max_cq. Fixes: 1550557 ("RDMA/erdma: Add verbs implementation") Link: https://lore.kernel.org/all/[email protected] Signed-off-by: Cheng Xu <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 1374901 commit 6cd8351

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/infiniband/hw/erdma/erdma_verbs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ int erdma_query_device(struct ib_device *ibdev, struct ib_device_attr *attr,
280280
attr->vendor_id = PCI_VENDOR_ID_ALIBABA;
281281
attr->vendor_part_id = dev->pdev->device;
282282
attr->hw_ver = dev->pdev->revision;
283-
attr->max_qp = dev->attrs.max_qp;
283+
attr->max_qp = dev->attrs.max_qp - 1;
284284
attr->max_qp_wr = min(dev->attrs.max_send_wr, dev->attrs.max_recv_wr);
285285
attr->max_qp_rd_atom = dev->attrs.max_ord;
286286
attr->max_qp_init_rd_atom = dev->attrs.max_ird;
@@ -291,7 +291,7 @@ int erdma_query_device(struct ib_device *ibdev, struct ib_device_attr *attr,
291291
attr->max_send_sge = dev->attrs.max_send_sge;
292292
attr->max_recv_sge = dev->attrs.max_recv_sge;
293293
attr->max_sge_rd = dev->attrs.max_sge_rd;
294-
attr->max_cq = dev->attrs.max_cq;
294+
attr->max_cq = dev->attrs.max_cq - 1;
295295
attr->max_cqe = dev->attrs.max_cqe;
296296
attr->max_mr = dev->attrs.max_mr;
297297
attr->max_pd = dev->attrs.max_pd;

0 commit comments

Comments
 (0)