* [PATCH for-next 0/2] RDMA/bnxt_re: Bug fixes for 6.12
@ 2024-09-04 10:04 Selvin Xavier
2024-09-04 10:04 ` [PATCH for-next 1/2] RDMA/bnxt_re: Fix the compatibility flag for variable size WQE Selvin Xavier
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Selvin Xavier @ 2024-09-04 10:04 UTC (permalink / raw)
To: leon, jgg; +Cc: linux-rdma, andrew.gospodarek, Selvin Xavier
Fixes couple of compatibility issues seen with older libraries
with variable size WQE patch series that is merged to 6.12.
Please review and apply to for-next.
Thanks,
Selvin Xavier
Selvin Xavier (2):
RDMA/bnxt_re: Fix the compatibility flag for variable size WQE
RDMA/bnxt_re: Fix the max WQE size for static WQE support
drivers/infiniband/hw/bnxt_re/ib_verbs.c | 25 +++++++++++++------------
drivers/infiniband/hw/bnxt_re/qplib_sp.h | 2 ++
2 files changed, 15 insertions(+), 12 deletions(-)
--
2.5.5
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH for-next 1/2] RDMA/bnxt_re: Fix the compatibility flag for variable size WQE
2024-09-04 10:04 [PATCH for-next 0/2] RDMA/bnxt_re: Bug fixes for 6.12 Selvin Xavier
@ 2024-09-04 10:04 ` Selvin Xavier
2024-09-04 10:04 ` [PATCH for-next 2/2] RDMA/bnxt_re: Fix the max WQE size for static WQE support Selvin Xavier
2024-09-05 10:31 ` [PATCH for-next 0/2] RDMA/bnxt_re: Bug fixes for 6.12 Leon Romanovsky
2 siblings, 0 replies; 4+ messages in thread
From: Selvin Xavier @ 2024-09-04 10:04 UTC (permalink / raw)
To: leon, jgg; +Cc: linux-rdma, andrew.gospodarek, Selvin Xavier
For older adapters that doesn't support variable size WQE,
driver is wrongly reporting that variable WQE is supported,
when the latest library is used.
Report the variable WQE capability only if the driver supports
it.
Fixes: 10a104c0debb ("RDMA/bnxt_re: Enable variable size WQEs for user space applications")
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
---
drivers/infiniband/hw/bnxt_re/ib_verbs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
index 82c1f3b..ecee691 100644
--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
@@ -4272,7 +4272,8 @@ int bnxt_re_alloc_ucontext(struct ib_ucontext *ctx, struct ib_udata *udata)
if (ureq.comp_mask & BNXT_RE_COMP_MASK_REQ_UCNTX_VAR_WQE_SUPPORT) {
resp.comp_mask |= BNXT_RE_UCNTX_CMASK_HAVE_MODE;
resp.mode = rdev->chip_ctx->modes.wqe_mode;
- uctx->cmask |= BNXT_RE_UCNTX_CAP_VAR_WQE_ENABLED;
+ if (resp.mode == BNXT_QPLIB_WQE_MODE_VARIABLE)
+ uctx->cmask |= BNXT_RE_UCNTX_CAP_VAR_WQE_ENABLED;
}
}
--
2.5.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH for-next 2/2] RDMA/bnxt_re: Fix the max WQE size for static WQE support
2024-09-04 10:04 [PATCH for-next 0/2] RDMA/bnxt_re: Bug fixes for 6.12 Selvin Xavier
2024-09-04 10:04 ` [PATCH for-next 1/2] RDMA/bnxt_re: Fix the compatibility flag for variable size WQE Selvin Xavier
@ 2024-09-04 10:04 ` Selvin Xavier
2024-09-05 10:31 ` [PATCH for-next 0/2] RDMA/bnxt_re: Bug fixes for 6.12 Leon Romanovsky
2 siblings, 0 replies; 4+ messages in thread
From: Selvin Xavier @ 2024-09-04 10:04 UTC (permalink / raw)
To: leon, jgg; +Cc: linux-rdma, andrew.gospodarek, Selvin Xavier
When variable size WQE is supported, max_qp_sges reported
is more than 6. For devices that supports variable size WQE,
the Send WQE size calculation is wrong when an an older library
that doesn't support variable size WQE is used.
Set the WQE size to 128 when static WQE is supported.
Fixes: de1d364c3815 ("RDMA/bnxt_re: Add support for Variable WQE in Genp7 adapters")
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
---
drivers/infiniband/hw/bnxt_re/ib_verbs.c | 22 +++++++++++-----------
drivers/infiniband/hw/bnxt_re/qplib_sp.h | 2 ++
2 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
index ecee691..89f6578 100644
--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
@@ -1006,23 +1006,23 @@ static int bnxt_re_setup_swqe_size(struct bnxt_re_qp *qp,
align = sizeof(struct sq_send_hdr);
ilsize = ALIGN(init_attr->cap.max_inline_data, align);
- sq->wqe_size = bnxt_re_get_wqe_size(ilsize, sq->max_sge);
- if (sq->wqe_size > bnxt_re_get_swqe_size(dev_attr->max_qp_sges))
- return -EINVAL;
- /* For gen p4 and gen p5 backward compatibility mode
- * wqe size is fixed to 128 bytes
+ /* For gen p4 and gen p5 fixed wqe compatibility mode
+ * wqe size is fixed to 128 bytes - ie 6 SGEs
*/
- if (sq->wqe_size < bnxt_re_get_swqe_size(dev_attr->max_qp_sges) &&
- qplqp->wqe_mode == BNXT_QPLIB_WQE_MODE_STATIC)
- sq->wqe_size = bnxt_re_get_swqe_size(dev_attr->max_qp_sges);
+ if (qplqp->wqe_mode == BNXT_QPLIB_WQE_MODE_STATIC) {
+ sq->wqe_size = bnxt_re_get_swqe_size(BNXT_STATIC_MAX_SGE);
+ sq->max_sge = BNXT_STATIC_MAX_SGE;
+ } else {
+
+ sq->wqe_size = bnxt_re_get_wqe_size(ilsize, sq->max_sge);
+ if (sq->wqe_size > bnxt_re_get_swqe_size(dev_attr->max_qp_sges))
+ return -EINVAL;
+ }
if (init_attr->cap.max_inline_data) {
qplqp->max_inline_data = sq->wqe_size -
sizeof(struct sq_send_hdr);
init_attr->cap.max_inline_data = qplqp->max_inline_data;
- if (qplqp->wqe_mode == BNXT_QPLIB_WQE_MODE_STATIC)
- sq->max_sge = qplqp->max_inline_data /
- sizeof(struct sq_sge);
}
return 0;
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_sp.h b/drivers/infiniband/hw/bnxt_re/qplib_sp.h
index 4ce44aa..acd9c14 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_sp.h
+++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.h
@@ -358,4 +358,6 @@ int bnxt_qplib_modify_cc(struct bnxt_qplib_res *res,
#define BNXT_VAR_MAX_SGE 13
#define BNXT_RE_MAX_RQ_WQES 65536
+#define BNXT_STATIC_MAX_SGE 6
+
#endif /* __BNXT_QPLIB_SP_H__*/
--
2.5.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH for-next 0/2] RDMA/bnxt_re: Bug fixes for 6.12
2024-09-04 10:04 [PATCH for-next 0/2] RDMA/bnxt_re: Bug fixes for 6.12 Selvin Xavier
2024-09-04 10:04 ` [PATCH for-next 1/2] RDMA/bnxt_re: Fix the compatibility flag for variable size WQE Selvin Xavier
2024-09-04 10:04 ` [PATCH for-next 2/2] RDMA/bnxt_re: Fix the max WQE size for static WQE support Selvin Xavier
@ 2024-09-05 10:31 ` Leon Romanovsky
2 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2024-09-05 10:31 UTC (permalink / raw)
To: jgg, Selvin Xavier; +Cc: linux-rdma, andrew.gospodarek
On Wed, 04 Sep 2024 03:04:11 -0700, Selvin Xavier wrote:
> Fixes couple of compatibility issues seen with older libraries
> with variable size WQE patch series that is merged to 6.12.
>
> Please review and apply to for-next.
>
> Thanks,
> Selvin Xavier
>
> [...]
Applied, thanks!
[1/2] RDMA/bnxt_re: Fix the compatibility flag for variable size WQE
https://git.kernel.org/rdma/rdma/c/b98993bf7e63b0
[2/2] RDMA/bnxt_re: Fix the max WQE size for static WQE support
https://git.kernel.org/rdma/rdma/c/fedf7d466d3d67
Best regards,
--
Leon Romanovsky <leon@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-09-05 10:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-04 10:04 [PATCH for-next 0/2] RDMA/bnxt_re: Bug fixes for 6.12 Selvin Xavier
2024-09-04 10:04 ` [PATCH for-next 1/2] RDMA/bnxt_re: Fix the compatibility flag for variable size WQE Selvin Xavier
2024-09-04 10:04 ` [PATCH for-next 2/2] RDMA/bnxt_re: Fix the max WQE size for static WQE support Selvin Xavier
2024-09-05 10:31 ` [PATCH for-next 0/2] RDMA/bnxt_re: Bug fixes for 6.12 Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox