]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
RDMA/bnxt_re: Update sq depth for app allocated QPs
authorSriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Tue, 19 May 2026 15:00:35 +0000 (20:30 +0530)
committerJason Gunthorpe <jgg@nvidia.com>
Sun, 24 May 2026 15:32:20 +0000 (12:32 -0300)
For app allocated QPs, there's no need to reserve extra slots.
The application accounts for this while allocating the SQ.

Link: https://patch.msgid.link/r/20260519150041.7251-4-sriharsha.basavapatna@broadcom.com
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Reviewed-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/bnxt_re/ib_verbs.c

index c3db53af3ff606e7ef9b69949ed895b114217d90..e5a8d3972a4201a7f4307a8838aeffa61876f0ff 100644 (file)
@@ -1541,7 +1541,8 @@ static void bnxt_re_adjust_gsi_rq_attr(struct bnxt_re_qp *qp)
 static int bnxt_re_init_sq_attr(struct bnxt_re_qp *qp,
                                struct ib_qp_init_attr *init_attr,
                                struct bnxt_re_ucontext *uctx,
-                               struct bnxt_re_qp_req *ureq)
+                               struct bnxt_re_qp_req *ureq,
+                               bool fixed_que_attr)
 {
        struct bnxt_qplib_dev_attr *dev_attr;
        struct bnxt_qplib_qp *qplqp;
@@ -1582,13 +1583,18 @@ static int bnxt_re_init_sq_attr(struct bnxt_re_qp *qp,
                        sq->max_sw_wqe = sq->max_wqe;
 
        }
-       sq->q_full_delta = diff + 1;
-       /*
-        * Reserving one slot for Phantom WQE. Application can
-        * post one extra entry in this case. But allowing this to avoid
-        * unexpected Queue full condition
-        */
-       qplqp->sq.q_full_delta -= 1;
+       if (!fixed_que_attr) {
+               sq->q_full_delta = diff + 1;
+               /*
+                * Reserving one slot for Phantom WQE. Application can
+                * post one extra entry in this case. But allowing this to avoid
+                * unexpected Queue full condition
+                */
+               qplqp->sq.q_full_delta -= 1;
+       } else {
+               sq->q_full_delta = 0;
+       }
+
        qplqp->sq.sg_info.pgsize = PAGE_SIZE;
        qplqp->sq.sg_info.pgshft = PAGE_SHIFT;
 
@@ -1737,7 +1743,7 @@ static int bnxt_re_init_qp_attr(struct bnxt_re_qp *qp, struct bnxt_re_pd *pd,
                bnxt_re_adjust_gsi_rq_attr(qp);
 
        /* Setup SQ */
-       rc = bnxt_re_init_sq_attr(qp, init_attr, uctx, ureq);
+       rc = bnxt_re_init_sq_attr(qp, init_attr, uctx, ureq, fixed_que_attr);
        if (rc)
                return rc;
        if (init_attr->qp_type == IB_QPT_GSI)