]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
RDMA/bnxt_re: Add send queue size check for variable wqe
authorDamodharam Ammepalli <damodharam.ammepalli@broadcom.com>
Tue, 17 Dec 2024 10:26:47 +0000 (15:56 +0530)
committerLeon Romanovsky <leon@kernel.org>
Thu, 19 Dec 2024 11:57:19 +0000 (06:57 -0500)
For the fixed WQE case, HW supports 0xFFFF WQEs.
For variable Size WQEs, HW treats this number as
the 16 bytes slots. The maximum supported WQEs
needs to be adjusted based on the number of slots.
Set a maximum WQE limit for variable WQE scenario.

Fixes: de1d364c3815 ("RDMA/bnxt_re: Add support for Variable WQE in Genp7 adapters")
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-4-kalesh-anakkur.purayil@broadcom.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/bnxt_re/qplib_sp.c

index 776f8f1f1432f0372a5408a68e652913f4105bcc..9df3e3271577de4ddf872db1b33e08c6ddd8d447 100644 (file)
@@ -138,6 +138,10 @@ int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw *rcfw,
                attr->max_qp_wqes -= BNXT_QPLIB_RESERVED_QP_WRS + 1;
        }
 
+       /* Adjust for max_qp_wqes for variable wqe */
+       if (cctx->modes.wqe_mode == BNXT_QPLIB_WQE_MODE_VARIABLE)
+               attr->max_qp_wqes = BNXT_VAR_MAX_WQE - 1;
+
        attr->max_qp_sges = cctx->modes.wqe_mode == BNXT_QPLIB_WQE_MODE_VARIABLE ?
                            min_t(u32, sb->max_sge_var_wqe, BNXT_VAR_MAX_SGE) : 6;
        attr->max_cq = le32_to_cpu(sb->max_cq);