mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 10:09:10 +02:00
RDMA/bnxt_re: Add a max slot check for SQ
The variable WQE mode must be validated against
the maximum slots supported by HW. The max supported
value is 64K. Adding a max and min check and fail if user
supplied value is more than the max supported and zero.
Fixes: d8ea645d69 ("RDMA/bnxt_re: Handle variable WQE support for user applications")
Link: https://patch.msgid.link/r/20260615224751.232802-10-selvin.xavier@broadcom.com
Reviewed-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
This commit is contained in:
parent
7d70c704a0
commit
dc95931b7e
|
|
@ -1748,6 +1748,9 @@ 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 && qplqp->wqe_mode == BNXT_QPLIB_WQE_MODE_VARIABLE &&
|
||||
(!ureq->sq_slots || ureq->sq_slots > BNXT_RE_MAX_SQ_SLOTS))
|
||||
return -EINVAL;
|
||||
if (fixed_que_attr) {
|
||||
if (qplqp->wqe_mode != BNXT_QPLIB_WQE_MODE_VARIABLE)
|
||||
return -EOPNOTSUPP;
|
||||
|
|
|
|||
|
|
@ -369,6 +369,7 @@ int bnxt_qplib_destroy_flow(struct bnxt_qplib_res *res);
|
|||
#define BNXT_VAR_MAX_SLOT_ALIGN 256
|
||||
#define BNXT_VAR_MAX_SGE 13
|
||||
#define BNXT_RE_MAX_RQ_WQES 65536
|
||||
#define BNXT_RE_MAX_SQ_SLOTS 65536
|
||||
|
||||
#define BNXT_STATIC_MAX_SGE 6
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user