]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
RDMA/bnxt_re: Fix max_qp_wrs reported
authorSelvin Xavier <selvin.xavier@broadcom.com>
Tue, 17 Dec 2024 10:26:45 +0000 (15:56 +0530)
committerLeon Romanovsky <leon@kernel.org>
Thu, 19 Dec 2024 11:57:19 +0000 (06:57 -0500)
While creating qps, driver adds one extra entry to the sq size
passed by the ULPs in order to avoid queue full condition.
When ULPs creates QPs with max_qp_wr reported, driver creates
QP with 1 more than the max_wqes supported by HW. Create QP fails
in this case. To avoid this error, reduce 1 entry in max_qp_wqes
and report it to the stack.

Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Link: https://patch.msgid.link/20241217102649.1377704-2-kalesh-anakkur.purayil@broadcom.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/bnxt_re/qplib_sp.c

index 7e20ae3d2c4fe1965be04f658d0741ad25c9cf98..73c9baaebb4e8b50656aa3ff529fbc8e7aa01021 100644 (file)
@@ -129,7 +129,7 @@ int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw *rcfw,
        attr->max_qp_init_rd_atom =
                sb->max_qp_init_rd_atom > BNXT_QPLIB_MAX_OUT_RD_ATOM ?
                BNXT_QPLIB_MAX_OUT_RD_ATOM : sb->max_qp_init_rd_atom;
-       attr->max_qp_wqes = le16_to_cpu(sb->max_qp_wr);
+       attr->max_qp_wqes = le16_to_cpu(sb->max_qp_wr) - 1;
        /*
         * 128 WQEs needs to be reserved for the HW (8916). Prevent
         * reporting the max number