Skip to content

Commit

Permalink
bnxt_re/lib: Enable Variable size Send Work Queue entries
Browse files Browse the repository at this point in the history
Report that the library support variable size WQEs. If the
driver supports it, handle the code for variable size WQEs.
Align the max slots to a multiple of 256 and pass the slot
numbers to the driver.

Signed-off-by: Hongguang Gao <hongguang.gao@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
  • Loading branch information
selvintxavier committed Aug 28, 2024
1 parent 983fd73 commit 5f008db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions providers/bnxt_re/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ static struct verbs_context *bnxt_re_alloc_context(struct ibv_device *vdev,
return NULL;

req.comp_mask |= BNXT_RE_COMP_MASK_REQ_UCNTX_POW2_SUPPORT;
req.comp_mask |= BNXT_RE_COMP_MASK_REQ_UCNTX_VAR_WQE_SUPPORT;
if (ibv_cmd_get_context(&cntx->ibvctx, &req.ibv_cmd, sizeof(req),
&resp.ibv_resp, sizeof(resp)))
goto failed;
Expand Down
6 changes: 6 additions & 0 deletions providers/bnxt_re/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,8 @@ static int bnxt_re_get_rq_slots(struct bnxt_re_dev *rdev, uint8_t qpmode,
return slots;
}

#define BNXT_VAR_MAX_SLOT_ALIGN 256

static int bnxt_re_get_sq_slots(struct bnxt_re_dev *rdev,
uint8_t qpmode, uint32_t nswr,
uint32_t nsge, uint32_t ils, uint32_t *esize)
Expand Down Expand Up @@ -1202,6 +1204,8 @@ static int bnxt_re_get_sq_slots(struct bnxt_re_dev *rdev,
if (esize)
*esize = wqe_size;
slots = (nswr * wqe_size) / stride;
if (qpmode == BNXT_RE_WQE_MODE_VARIABLE)
slots = align(slots, BNXT_VAR_MAX_SLOT_ALIGN);
return slots;
}

Expand Down Expand Up @@ -1509,6 +1513,8 @@ struct ibv_qp *bnxt_re_create_qp(struct ibv_pd *ibvpd,
req.qpsva = (uintptr_t)qp->jsqq->hwque->va;
req.qprva = qp->jrqq ? (uintptr_t)qp->jrqq->hwque->va : 0;
req.qp_handle = (uintptr_t)qp;
if (qp->qpmode == BNXT_RE_WQE_MODE_VARIABLE)
req.sq_slots = qattr[BNXT_RE_QATTR_SQ_INDX].slots;

if (ibv_cmd_create_qp(ibvpd, &qp->ibvqp, attr, &req.ibv_cmd, sizeof(req),
&resp.ibv_resp, sizeof(resp)))
Expand Down

0 comments on commit 5f008db

Please sign in to comment.