* [PATCH for-next v2 3/4] RDMA/bnxt_re: Simplify PSN size and QP HWQ setup paths
2026-11-30 14:53 [PATCH for-next v2 0/4] RDMA/bnxt_re: CQ and QP updates for app allocated queues Selvin Xavier
` (2 preceding siblings ...)
2026-11-30 14:53 ` [PATCH for-next v2 2/4] RDMA/bnxt_re: Set CQ coalescing max buffers to 1 for CQs with depth 1 Selvin Xavier
@ 2026-11-30 14:53 ` Selvin Xavier
2026-11-30 14:53 ` [PATCH for-next v2 4/4] RDMA/bnxt_re: Allow user library to request STATIC WQE mode per-QP Selvin Xavier
4 siblings, 0 replies; 7+ messages in thread
From: Selvin Xavier @ 2026-11-30 14:53 UTC (permalink / raw)
To: leon, jgg
Cc: linux-rdma, andrew.gospodarek, kalesh-anakkur.purayil,
Abhishek Mohapatra, Kashyap Desai, Selvin Xavier
From: Abhishek Mohapatra <abhishek.mohapatra@broadcom.com>
Factor out the SQ/RQ page size and level encoding into a helper,
flatten the RQ allocation in bnxt_re_setup_qp_hwqs(), fix the error
path to not free the RQ HWQ when an SRQ is used, and simplify
bnxt_re_get_psn_bytes(). No functional change intended.
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Abhishek Mohapatra <abhishek.mohapatra@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
---
drivers/infiniband/hw/bnxt_re/ib_verbs.c | 96 ++++++++++++------------
1 file changed, 48 insertions(+), 48 deletions(-)
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
index c67f263c759f..92d8995b5895 100644
--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
@@ -1163,28 +1163,30 @@ static int bnxt_re_get_psn_bytes(struct bnxt_re_dev *rdev,
struct bnxt_re_qp_req *ureq,
bool fixed_que_attr)
{
+ bool msn_tbl = rdev->dev_attr &&
+ _is_host_msn_table(rdev->dev_attr->dev_cap_flags2);
int psn_sz, psn_nume;
- if (rdev->dev_attr &&
- _is_host_msn_table(rdev->dev_attr->dev_cap_flags2))
+ if (msn_tbl)
psn_sz = sizeof(struct sq_msn_search);
else
psn_sz = bnxt_qplib_is_chip_gen_p5_p7(rdev->chip_ctx) ?
sizeof(struct sq_psn_search_ext) :
sizeof(struct sq_psn_search);
- if (!fixed_que_attr) {
- if (cntx && bnxt_re_is_var_size_supported(rdev, cntx)) {
- psn_nume = ureq->sq_slots;
- } else {
- psn_nume = (qplib_qp->wqe_mode == BNXT_QPLIB_WQE_MODE_STATIC) ?
- qplib_qp->sq.max_wqe : ((qplib_qp->sq.max_wqe * qplib_qp->sq.wqe_size) /
- sizeof(struct bnxt_qplib_sge));
- }
- if (_is_host_msn_table(rdev->qplib_res.dattr->dev_cap_flags2))
- psn_nume = roundup_pow_of_two(psn_nume);
- } else {
- psn_nume = ureq->sq_npsn;
- }
+
+ if (fixed_que_attr)
+ return ureq->sq_npsn * psn_sz;
+
+ if (cntx && bnxt_re_is_var_size_supported(rdev, cntx))
+ psn_nume = ureq->sq_slots;
+ else if (qplib_qp->wqe_mode == BNXT_QPLIB_WQE_MODE_STATIC)
+ psn_nume = qplib_qp->sq.max_wqe;
+ else
+ psn_nume = (qplib_qp->sq.max_wqe * qplib_qp->sq.wqe_size) /
+ sizeof(struct bnxt_qplib_sge);
+
+ if (msn_tbl)
+ psn_nume = roundup_pow_of_two(psn_nume);
return psn_nume * psn_sz;
}
@@ -1354,61 +1356,58 @@ static int bnxt_re_qp_alloc_init_xrrq(struct bnxt_re_qp *qp)
return rc;
}
+static void bnxt_re_set_hwq_pg_sz_lvl(struct bnxt_qplib_hwq *hwq, u8 pg_sz_sft,
+ u8 lvl_mask, u8 lvl_sft)
+{
+ hwq->pg_sz_lvl = (bnxt_qplib_base_pg_size(hwq) << pg_sz_sft) |
+ ((hwq->level & lvl_mask) << lvl_sft);
+}
+
static int bnxt_re_setup_qp_hwqs(struct bnxt_re_qp *qp, bool fixed_que_attr)
{
struct bnxt_qplib_res *res = &qp->rdev->qplib_res;
- struct bnxt_qplib_qp *qplib_qp = &qp->qplib_qp;
struct bnxt_qplib_hwq_attr hwq_attr = {};
+ struct bnxt_qplib_qp *qplib_qp = &qp->qplib_qp;
struct bnxt_qplib_q *sq = &qplib_qp->sq;
struct bnxt_qplib_q *rq = &qplib_qp->rq;
u8 wqe_mode = qplib_qp->wqe_mode;
- u8 pg_sz_lvl;
int rc;
hwq_attr.res = res;
hwq_attr.sginfo = &sq->sg_info;
hwq_attr.stride = bnxt_qplib_get_stride();
hwq_attr.aux_stride = qplib_qp->psn_sz;
+ hwq_attr.type = HWQ_TYPE_QUEUE;
if (!fixed_que_attr) {
hwq_attr.depth = bnxt_qplib_get_depth(sq, wqe_mode, true);
- hwq_attr.aux_depth = (qplib_qp->psn_sz) ?
- bnxt_qplib_set_sq_size(sq, wqe_mode) : 0;
- if (qplib_qp->is_host_msn_tbl && qplib_qp->psn_sz)
- hwq_attr.aux_depth = qplib_qp->msn_tbl_sz;
+ if (qplib_qp->psn_sz)
+ hwq_attr.aux_depth = qplib_qp->is_host_msn_tbl ?
+ qplib_qp->msn_tbl_sz :
+ bnxt_qplib_set_sq_size(sq, wqe_mode);
} else {
hwq_attr.depth = sq->max_wqe;
hwq_attr.aux_depth = qplib_qp->msn_tbl_sz;
}
- hwq_attr.type = HWQ_TYPE_QUEUE;
rc = bnxt_qplib_alloc_init_hwq(&sq->hwq, &hwq_attr);
if (rc)
return rc;
+ bnxt_re_set_hwq_pg_sz_lvl(&sq->hwq, CMDQ_CREATE_QP_SQ_PG_SIZE_SFT,
+ CMDQ_CREATE_QP_SQ_LVL_MASK,
+ CMDQ_CREATE_QP_SQ_LVL_SFT);
+
+ if (!qplib_qp->srq) {
+ hwq_attr.sginfo = &rq->sg_info;
+ hwq_attr.depth = bnxt_qplib_get_depth(rq, wqe_mode, false);
+ hwq_attr.aux_stride = 0;
+ hwq_attr.aux_depth = 0;
+ rc = bnxt_qplib_alloc_init_hwq(&rq->hwq, &hwq_attr);
+ if (rc)
+ goto free_sq_hwq;
+ bnxt_re_set_hwq_pg_sz_lvl(&rq->hwq, CMDQ_CREATE_QP_RQ_PG_SIZE_SFT,
+ CMDQ_CREATE_QP_RQ_LVL_MASK,
+ CMDQ_CREATE_QP_RQ_LVL_SFT);
+ }
- pg_sz_lvl = bnxt_qplib_base_pg_size(&sq->hwq) << CMDQ_CREATE_QP_SQ_PG_SIZE_SFT;
- pg_sz_lvl |= ((sq->hwq.level & CMDQ_CREATE_QP_SQ_LVL_MASK) <<
- CMDQ_CREATE_QP_SQ_LVL_SFT);
- sq->hwq.pg_sz_lvl = pg_sz_lvl;
-
- if (qplib_qp->srq)
- goto done;
-
- hwq_attr.res = res;
- hwq_attr.sginfo = &rq->sg_info;
- hwq_attr.stride = bnxt_qplib_get_stride();
- hwq_attr.depth = bnxt_qplib_get_depth(rq, qplib_qp->wqe_mode, false);
- hwq_attr.aux_stride = 0;
- hwq_attr.aux_depth = 0;
- hwq_attr.type = HWQ_TYPE_QUEUE;
- rc = bnxt_qplib_alloc_init_hwq(&rq->hwq, &hwq_attr);
- if (rc)
- goto free_sq_hwq;
- pg_sz_lvl = bnxt_qplib_base_pg_size(&rq->hwq) <<
- CMDQ_CREATE_QP_RQ_PG_SIZE_SFT;
- pg_sz_lvl |= ((rq->hwq.level & CMDQ_CREATE_QP_RQ_LVL_MASK) <<
- CMDQ_CREATE_QP_RQ_LVL_SFT);
- rq->hwq.pg_sz_lvl = pg_sz_lvl;
-
-done:
if (qplib_qp->psn_sz) {
rc = bnxt_re_qp_alloc_init_xrrq(qp);
if (rc)
@@ -1417,7 +1416,8 @@ static int bnxt_re_setup_qp_hwqs(struct bnxt_re_qp *qp, bool fixed_que_attr)
return 0;
free_rq_hwq:
- bnxt_qplib_free_hwq(res, &rq->hwq);
+ if (!qplib_qp->srq)
+ bnxt_qplib_free_hwq(res, &rq->hwq);
free_sq_hwq:
bnxt_qplib_free_hwq(res, &sq->hwq);
return rc;
--
2.39.3
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH for-next v2 4/4] RDMA/bnxt_re: Allow user library to request STATIC WQE mode per-QP
2026-11-30 14:53 [PATCH for-next v2 0/4] RDMA/bnxt_re: CQ and QP updates for app allocated queues Selvin Xavier
` (3 preceding siblings ...)
2026-11-30 14:53 ` [PATCH for-next v2 3/4] RDMA/bnxt_re: Simplify PSN size and QP HWQ setup paths Selvin Xavier
@ 2026-11-30 14:53 ` Selvin Xavier
2026-11-30 9:51 ` sashiko-bot
4 siblings, 1 reply; 7+ messages in thread
From: Selvin Xavier @ 2026-11-30 14:53 UTC (permalink / raw)
To: leon, jgg
Cc: linux-rdma, andrew.gospodarek, kalesh-anakkur.purayil,
Abhishek Mohapatra, Kashyap Desai, Selvin Xavier
From: Abhishek Mohapatra <abhishek.mohapatra@broadcom.com>
Allow the provider library to explicitly request STATIC WQE mode at
creation through a new wqe_mode field in the create-QP request,
gated by a comp_mask flag. This lets applications that create QP
directly to use fixed-size WQEs. The SQ is sized from the application
provided slot count and PSN/MSN sizing follows the
selected mode.
STATIC mode is rejected if the device reports fewer SGEs than the
fixed STATIC WQE size. On non-P5/P7 chips the 128 WQEs reserved for HW
are kept. In variable WQE mode, sq_slots must be a multiple of 256.
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Abhishek Mohapatra <abhishek.mohapatra@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
---
drivers/infiniband/hw/bnxt_re/ib_verbs.c | 122 +++++++++++++++++------
include/uapi/rdma/bnxt_re-abi.h | 9 ++
2 files changed, 102 insertions(+), 29 deletions(-)
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
index 92d8995b5895..ac7db219bfc1 100644
--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
@@ -1163,6 +1163,7 @@ static int bnxt_re_get_psn_bytes(struct bnxt_re_dev *rdev,
struct bnxt_re_qp_req *ureq,
bool fixed_que_attr)
{
+ bool is_static = qplib_qp->wqe_mode == BNXT_QPLIB_WQE_MODE_STATIC;
bool msn_tbl = rdev->dev_attr &&
_is_host_msn_table(rdev->dev_attr->dev_cap_flags2);
int psn_sz, psn_nume;
@@ -1174,13 +1175,15 @@ static int bnxt_re_get_psn_bytes(struct bnxt_re_dev *rdev,
sizeof(struct sq_psn_search_ext) :
sizeof(struct sq_psn_search);
- if (fixed_que_attr)
+ /* Fixed-attribute variable-WQE QPs get the PSN count from userspace */
+ if (fixed_que_attr && !is_static)
return ureq->sq_npsn * psn_sz;
- if (cntx && bnxt_re_is_var_size_supported(rdev, cntx))
- psn_nume = ureq->sq_slots;
- else if (qplib_qp->wqe_mode == BNXT_QPLIB_WQE_MODE_STATIC)
+ /* STATIC mode matches msn_tbl_sz in bnxt_re_qp_calculate_msn_psn_size() */
+ if (is_static)
psn_nume = qplib_qp->sq.max_wqe;
+ else if (cntx && bnxt_re_is_var_size_supported(rdev, cntx))
+ psn_nume = ureq->sq_slots;
else
psn_nume = (qplib_qp->sq.max_wqe * qplib_qp->sq.wqe_size) /
sizeof(struct bnxt_qplib_sge);
@@ -1366,8 +1369,8 @@ static void bnxt_re_set_hwq_pg_sz_lvl(struct bnxt_qplib_hwq *hwq, u8 pg_sz_sft,
static int bnxt_re_setup_qp_hwqs(struct bnxt_re_qp *qp, bool fixed_que_attr)
{
struct bnxt_qplib_res *res = &qp->rdev->qplib_res;
- struct bnxt_qplib_hwq_attr hwq_attr = {};
struct bnxt_qplib_qp *qplib_qp = &qp->qplib_qp;
+ struct bnxt_qplib_hwq_attr hwq_attr = {};
struct bnxt_qplib_q *sq = &qplib_qp->sq;
struct bnxt_qplib_q *rq = &qplib_qp->rq;
u8 wqe_mode = qplib_qp->wqe_mode;
@@ -1378,7 +1381,8 @@ static int bnxt_re_setup_qp_hwqs(struct bnxt_re_qp *qp, bool fixed_que_attr)
hwq_attr.stride = bnxt_qplib_get_stride();
hwq_attr.aux_stride = qplib_qp->psn_sz;
hwq_attr.type = HWQ_TYPE_QUEUE;
- if (!fixed_que_attr) {
+ /* STATIC mode (also for fixed-attribute QPs) is sized from max_wqe */
+ if (!fixed_que_attr || wqe_mode == BNXT_QPLIB_WQE_MODE_STATIC) {
hwq_attr.depth = bnxt_qplib_get_depth(sq, wqe_mode, true);
if (qplib_qp->psn_sz)
hwq_attr.aux_depth = qplib_qp->is_host_msn_tbl ?
@@ -1509,6 +1513,7 @@ static int bnxt_re_init_rq_attr(struct bnxt_re_qp *qp,
struct bnxt_qplib_qp *qplqp;
struct bnxt_re_dev *rdev;
struct bnxt_qplib_q *rq;
+ u32 max_sge;
rdev = qp->rdev;
qplqp = &qp->qplib_qp;
@@ -1522,12 +1527,16 @@ static int bnxt_re_init_rq_attr(struct bnxt_re_qp *qp,
qplqp->srq = &srq->qplib_srq;
rq->max_wqe = 0;
} else {
- rq->max_sge = init_attr->cap.max_recv_sge;
- if (rq->max_sge > dev_attr->max_qp_sges)
- rq->max_sge = dev_attr->max_qp_sges;
+ /* Explicitly requested STATIC mode WQEs are fixed at
+ * BNXT_STATIC_MAX_SGE SGEs. Legacy QPs keep their geometry.
+ */
+ max_sge = dev_attr->max_qp_sges;
+ if (fixed_que_attr && qplqp->wqe_mode == BNXT_QPLIB_WQE_MODE_STATIC)
+ max_sge = min_t(u32, max_sge, BNXT_STATIC_MAX_SGE);
+ rq->max_sge = min_t(u32, init_attr->cap.max_recv_sge, max_sge);
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);
+ max_sge);
if (!fixed_que_attr) {
/* Allocate 1 more than what's provided so posting max doesn't
* mean empty.
@@ -1576,6 +1585,7 @@ static int bnxt_re_init_sq_attr(struct bnxt_re_qp *qp,
struct bnxt_re_dev *rdev;
struct bnxt_qplib_q *sq;
int diff = 0;
+ u32 max_sge;
int rc;
rdev = qp->rdev;
@@ -1589,8 +1599,11 @@ static int bnxt_re_init_sq_attr(struct bnxt_re_qp *qp,
sq->max_sw_wqe = ureq->sq_slots;
sq->wqe_size = sizeof(struct sq_sge);
} else {
- if (sq->max_sge > dev_attr->max_qp_sges) {
- sq->max_sge = dev_attr->max_qp_sges;
+ max_sge = dev_attr->max_qp_sges;
+ if (fixed_que_attr && qplqp->wqe_mode == BNXT_QPLIB_WQE_MODE_STATIC)
+ max_sge = min_t(u32, max_sge, BNXT_STATIC_MAX_SGE);
+ if (sq->max_sge > max_sge) {
+ sq->max_sge = max_sge;
init_attr->cap.max_send_sge = sq->max_sge;
}
@@ -1598,17 +1611,24 @@ static int bnxt_re_init_sq_attr(struct bnxt_re_qp *qp,
if (rc)
return rc;
- /* Allocate 128 + 1 more than what's provided */
- if (qplqp->wqe_mode != BNXT_QPLIB_WQE_MODE_VARIABLE)
- diff = BNXT_QPLIB_RESERVED_QP_WRS;
- sq->max_wqe = bnxt_re_init_depth(
- init_attr->cap.max_send_wr + diff + 1,
- dev_attr->max_qp_wqes + diff + 1, uctx);
- if (qplqp->wqe_mode == BNXT_QPLIB_WQE_MODE_VARIABLE)
- sq->max_sw_wqe = bnxt_qplib_get_depth(sq, qplqp->wqe_mode, true);
- else
+ if (uctx && fixed_que_attr) {
+ sq->max_wqe = ((u64)ureq->sq_slots * bnxt_qplib_get_stride()) /
+ sq->wqe_size;
+ /* Bound the depth by the device limit */
+ if (!sq->max_wqe || sq->max_wqe > dev_attr->max_qp_wqes + 1)
+ return -EINVAL;
sq->max_sw_wqe = sq->max_wqe;
-
+ } else {
+ /* Allocate 128 + 1 more than what's provided */
+ if (qplqp->wqe_mode != BNXT_QPLIB_WQE_MODE_VARIABLE)
+ diff = BNXT_QPLIB_RESERVED_QP_WRS;
+ sq->max_wqe = bnxt_re_init_depth(init_attr->cap.max_send_wr + diff + 1,
+ dev_attr->max_qp_wqes + diff + 1, uctx);
+ if (qplqp->wqe_mode == BNXT_QPLIB_WQE_MODE_VARIABLE)
+ sq->max_sw_wqe = bnxt_qplib_get_depth(sq, qplqp->wqe_mode, true);
+ else
+ sq->max_sw_wqe = sq->max_wqe;
+ }
}
if (!fixed_que_attr) {
sq->q_full_delta = diff + 1;
@@ -1618,6 +1638,12 @@ static int bnxt_re_init_sq_attr(struct bnxt_re_qp *qp,
* unexpected Queue full condition
*/
qplqp->sq.q_full_delta -= 1;
+ } else if (qplqp->wqe_mode == BNXT_QPLIB_WQE_MODE_STATIC &&
+ !bnxt_qplib_is_chip_gen_p5_p7(rdev->chip_ctx)) {
+ /* Legacy chips need 128 WQEs reserved for HW (8916) */
+ if (sq->max_wqe <= BNXT_QPLIB_RESERVED_QP_WRS)
+ return -EINVAL;
+ sq->q_full_delta = BNXT_QPLIB_RESERVED_QP_WRS;
} else {
sq->q_full_delta = 0;
}
@@ -1699,7 +1725,7 @@ static void bnxt_re_qp_calculate_msn_psn_size(struct bnxt_re_qp *qp,
/* Update msn tbl size */
if (qplib_qp->is_host_msn_tbl && qplib_qp->psn_sz) {
- if (!fixed_que_attr) {
+ if (!fixed_que_attr || wqe_mode == BNXT_QPLIB_WQE_MODE_STATIC) {
if (wqe_mode == BNXT_QPLIB_WQE_MODE_STATIC)
qplib_qp->msn_tbl_sz =
roundup_pow_of_two(bnxt_qplib_set_sq_size(sq, wqe_mode));
@@ -1726,6 +1752,7 @@ static int bnxt_re_init_qp_attr(struct bnxt_re_qp *qp, struct bnxt_re_pd *pd,
struct bnxt_qplib_qp *qplqp;
struct bnxt_re_dev *rdev;
struct bnxt_re_cq *cq;
+ bool static_req = false;
int rc = 0, qptype;
rdev = qp->rdev;
@@ -1743,15 +1770,51 @@ static int bnxt_re_init_qp_attr(struct bnxt_re_qp *qp, struct bnxt_re_pd *pd,
return qptype;
qplqp->type = (u8)qptype;
qplqp->wqe_mode = bnxt_re_is_var_size_supported(rdev, uctx);
+
+ if (uctx && (ureq->comp_mask & BNXT_RE_QP_REQ_MASK_WQE_MODE)) {
+ switch (ureq->wqe_mode) {
+ case BNXT_RE_QP_REQ_WQE_MODE_DEFAULT:
+ break;
+ case BNXT_RE_QP_REQ_WQE_MODE_VARIABLE:
+ if (!bnxt_re_is_var_size_supported(rdev, uctx))
+ return -EOPNOTSUPP;
+ qplqp->wqe_mode = BNXT_QPLIB_WQE_MODE_VARIABLE;
+ break;
+ case BNXT_RE_QP_REQ_WQE_MODE_STATIC:
+ if (!fixed_que_attr)
+ return -EINVAL;
+ /* STATIC WQEs always use BNXT_STATIC_MAX_SGE SGEs */
+ if (dev_attr->max_qp_sges < BNXT_STATIC_MAX_SGE)
+ return -EOPNOTSUPP;
+ qplqp->wqe_mode = BNXT_QPLIB_WQE_MODE_STATIC;
+ static_req = true;
+ break;
+ default:
+ return -EINVAL;
+ }
+ }
if (uctx && qplqp->wqe_mode == BNXT_QPLIB_WQE_MODE_VARIABLE &&
- (!ureq->sq_slots || ureq->sq_slots > BNXT_RE_MAX_SQ_SLOTS))
+ (!ureq->sq_slots || ureq->sq_slots > BNXT_RE_MAX_SQ_SLOTS ||
+ !IS_ALIGNED(ureq->sq_slots, BNXT_VAR_MAX_SLOT_ALIGN)))
return -EINVAL;
if (fixed_que_attr) {
- if (qplqp->wqe_mode != BNXT_QPLIB_WQE_MODE_VARIABLE)
+ if (qplqp->wqe_mode == BNXT_QPLIB_WQE_MODE_VARIABLE) {
+ if (!ureq->sq_npsn ||
+ ureq->sq_npsn > roundup_pow_of_two(ureq->sq_slots / 2))
+ return -EINVAL;
+ } else if (!static_req) {
+ /* STATIC must be requested explicitly, not implied */
return -EOPNOTSUPP;
- if (!ureq->sq_npsn ||
- ureq->sq_npsn > roundup_pow_of_two(ureq->sq_slots / 2))
- return -EINVAL;
+ } else {
+ /* sq_slots must hold a whole number of static WQEs */
+ u32 slots_per_wqe = bnxt_re_get_swqe_size(BNXT_STATIC_MAX_SGE) /
+ bnxt_qplib_get_stride();
+
+ if (!ureq->sq_slots ||
+ ureq->sq_slots > BNXT_RE_MAX_SQ_SLOTS ||
+ ureq->sq_slots % slots_per_wqe)
+ return -EINVAL;
+ }
}
qplqp->dev_cap_flags = dev_attr->dev_cap_flags;
qplqp->cctx = rdev->chip_ctx;
@@ -1955,7 +2018,8 @@ int bnxt_re_create_qp(struct ib_qp *ib_qp, struct ib_qp_init_attr *qp_init_attr,
uctx = rdma_udata_to_drv_context(udata, struct bnxt_re_ucontext, ib_uctx);
if (udata) {
rc = ib_copy_validate_udata_in_cm(udata, ureq, qp_handle,
- BNXT_RE_QP_REQ_MASK_FIXED_QUE_ATTR);
+ BNXT_RE_QP_REQ_MASK_FIXED_QUE_ATTR |
+ BNXT_RE_QP_REQ_MASK_WQE_MODE);
if (rc)
return rc;
diff --git a/include/uapi/rdma/bnxt_re-abi.h b/include/uapi/rdma/bnxt_re-abi.h
index 15ed2a51f8f1..79d458ed3af5 100644
--- a/include/uapi/rdma/bnxt_re-abi.h
+++ b/include/uapi/rdma/bnxt_re-abi.h
@@ -128,6 +128,13 @@ struct bnxt_re_resize_cq_req {
enum bnxt_re_qp_mask {
BNXT_RE_QP_REQ_MASK_FIXED_QUE_ATTR = 0x1,
+ BNXT_RE_QP_REQ_MASK_WQE_MODE = 0x2,
+};
+
+enum bnxt_re_qp_req_wqe_mode {
+ BNXT_RE_QP_REQ_WQE_MODE_DEFAULT = 0x0,
+ BNXT_RE_QP_REQ_WQE_MODE_VARIABLE = 0x1,
+ BNXT_RE_QP_REQ_WQE_MODE_STATIC = 0x2,
};
struct bnxt_re_qp_req {
@@ -137,6 +144,8 @@ struct bnxt_re_qp_req {
__aligned_u64 comp_mask;
__u32 sq_slots;
__u32 sq_npsn;
+ __u32 wqe_mode;
+ __u32 rsvd0;
};
enum bnxt_re_create_qp_attrs {
--
2.39.3
^ permalink raw reply related [flat|nested] 7+ messages in thread