From: Sriharsha Basavapatna Date: Tue, 19 May 2026 15:00:34 +0000 (+0530) Subject: RDMA/bnxt_re: Update rq depth for app allocated QPs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3d27ad0184c81048a226476834d2ce8225dd1f8;p=thirdparty%2Fkernel%2Flinux.git RDMA/bnxt_re: Update rq depth for app allocated QPs For app allocated QPs, there's no need to add extra slots or to round up the slot count. Use 'max_recv_wr' count provided by the application as is. Link: https://patch.msgid.link/r/20260519150041.7251-3-sriharsha.basavapatna@broadcom.com Signed-off-by: Sriharsha Basavapatna Reviewed-by: Selvin Xavier Signed-off-by: Jason Gunthorpe --- diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index d50ec97518426..c3db53af3ff60 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -1475,7 +1475,8 @@ fail: static int bnxt_re_init_rq_attr(struct bnxt_re_qp *qp, struct ib_qp_init_attr *init_attr, - struct bnxt_re_ucontext *uctx) + struct bnxt_re_ucontext *uctx, + bool fixed_que_attr) { struct bnxt_qplib_dev_attr *dev_attr; struct bnxt_qplib_qp *qplqp; @@ -1500,12 +1501,16 @@ static int bnxt_re_init_rq_attr(struct bnxt_re_qp *qp, init_attr->cap.max_recv_sge = rq->max_sge; rq->wqe_size = bnxt_re_setup_rwqe_size(qplqp, rq->max_sge, dev_attr->max_qp_sges); - /* Allocate 1 more than what's provided so posting max doesn't - * mean empty. - */ - rq->max_wqe = bnxt_re_init_depth(init_attr->cap.max_recv_wr + 1, - dev_attr->max_qp_wqes + 1, - uctx); + if (!fixed_que_attr) { + /* Allocate 1 more than what's provided so posting max doesn't + * mean empty. + */ + rq->max_wqe = bnxt_re_init_depth(init_attr->cap.max_recv_wr + 1, + dev_attr->max_qp_wqes + 1, + uctx); + } else { + rq->max_wqe = init_attr->cap.max_recv_wr; + } rq->max_sw_wqe = rq->max_wqe; rq->q_full_delta = 0; rq->sg_info.pgsize = PAGE_SIZE; @@ -1676,6 +1681,7 @@ static int bnxt_re_init_qp_attr(struct bnxt_re_qp *qp, struct bnxt_re_pd *pd, { struct bnxt_qplib_dev_attr *dev_attr; struct bnxt_qplib_qp *qplqp; + bool fixed_que_attr = false; struct bnxt_re_dev *rdev; struct bnxt_re_cq *cq; int rc = 0, qptype; @@ -1724,7 +1730,7 @@ static int bnxt_re_init_qp_attr(struct bnxt_re_qp *qp, struct bnxt_re_pd *pd, } /* Setup RQ/SRQ */ - rc = bnxt_re_init_rq_attr(qp, init_attr, uctx); + rc = bnxt_re_init_rq_attr(qp, init_attr, uctx, fixed_que_attr); if (rc) return rc; if (init_attr->qp_type == IB_QPT_GSI)