mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
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 <sriharsha.basavapatna@broadcom.com> Reviewed-by: Selvin Xavier <selvin.xavier@broadcom.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
This commit is contained in:
parent
9a79dcbedc
commit
a3d27ad018
|
|
@ -1475,7 +1475,8 @@ static struct bnxt_re_qp *bnxt_re_create_shadow_qp
|
|||
|
||||
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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user