aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamodharam Ammepalli <damodharam.ammepalli@broadcom.com>2024-12-17 15:56:48 +0530
committerLeon Romanovsky <leon@kernel.org>2024-12-19 06:57:19 -0500
commitbb839f3ace0fee532a0487b692cc4d868fccb7cf (patch)
treece6b2cc29b364ca51362001e393801117b96e349
parentRDMA/bnxt_re: Add send queue size check for variable wqe (diff)
downloadwireguard-linux-bb839f3ace0fee532a0487b692cc4d868fccb7cf.tar.xz
wireguard-linux-bb839f3ace0fee532a0487b692cc4d868fccb7cf.zip
RDMA/bnxt_re: Fix MSN table size for variable wqe mode
For variable size wqe mode, the MSN table size should be half the size of the SQ depth. Fixing this to avoid wrap around problems in the retransmission path. Fixes: de1d364c3815 ("RDMA/bnxt_re: Add support for Variable WQE in Genp7 adapters") Reviewed-by: Kashyap Desai <kashyap.desai@broadcom.com> Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Signed-off-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com> Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com> Link: https://patch.msgid.link/20241217102649.1377704-5-kalesh-anakkur.purayil@broadcom.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to '')
-rw-r--r--drivers/infiniband/hw/bnxt_re/qplib_fp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
index d8a2a929bbe3..951ad90f5aa9 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c
+++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
@@ -1033,7 +1033,12 @@ int bnxt_qplib_create_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp)
: 0;
/* Update msn tbl size */
if (qp->is_host_msn_tbl && psn_sz) {
- hwq_attr.aux_depth = roundup_pow_of_two(bnxt_qplib_set_sq_size(sq, qp->wqe_mode));
+ if (qp->wqe_mode == BNXT_QPLIB_WQE_MODE_STATIC)
+ hwq_attr.aux_depth =
+ roundup_pow_of_two(bnxt_qplib_set_sq_size(sq, qp->wqe_mode));
+ else
+ hwq_attr.aux_depth =
+ roundup_pow_of_two(bnxt_qplib_set_sq_size(sq, qp->wqe_mode)) / 2;
qp->msn_tbl_sz = hwq_attr.aux_depth;
qp->msn = 0;
}