]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
RDMA/bnxt_re: Fix reporting maximum SRQs on P7 chips
authorPreethi G <preethi.gurusiddalingeswaraswamy@broadcom.com>
Mon, 3 Mar 2025 16:59:38 +0000 (08:59 -0800)
committerLeon Romanovsky <leon@kernel.org>
Mon, 3 Mar 2025 19:18:04 +0000 (14:18 -0500)
Firmware reports support for additional SRQs in the max_srq_ext field.
In CREQ_QUERY_FUNC response, if MAX_SRQ_EXTENDED flag is set, driver
should derive the total number of max SRQs by the summation of
"max_srq" and "max_srq_ext" fields.

Fixes: b1b66ae094cd ("bnxt_en: Use FW defined resource limits for RoCE")
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Preethi G <preethi.gurusiddalingeswaraswamy@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Link: https://patch.msgid.link/1741021178-2569-4-git-send-email-selvin.xavier@broadcom.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/bnxt_re/qplib_res.h
drivers/infiniband/hw/bnxt_re/qplib_sp.c
drivers/infiniband/hw/bnxt_re/roce_hsi.h

index 2fb540f0e72717268806461809720075672f378f..6a13927674b44592e73434f75856f74730753daf 100644 (file)
@@ -607,4 +607,9 @@ static inline bool _is_cq_coalescing_supported(u16 dev_cap_ext_flags2)
        return dev_cap_ext_flags2 & CREQ_QUERY_FUNC_RESP_SB_CQ_COALESCING_SUPPORTED;
 }
 
+static inline bool _is_max_srq_ext_supported(u16 dev_cap_ext_flags_2)
+{
+       return !!(dev_cap_ext_flags_2 & CREQ_QUERY_FUNC_RESP_SB_MAX_SRQ_EXTENDED);
+}
+
 #endif /* __BNXT_QPLIB_RES_H__ */
index 4ccd4405355afad217fc2740b375c82ce1bc6440..f231e886ad9d5547edc5b25f437ab56dad93be04 100644 (file)
@@ -176,6 +176,9 @@ int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw *rcfw)
        attr->dev_cap_flags = le16_to_cpu(sb->dev_cap_flags);
        attr->dev_cap_flags2 = le16_to_cpu(sb->dev_cap_ext_flags_2);
 
+       if (_is_max_srq_ext_supported(attr->dev_cap_flags2))
+               attr->max_srq += le16_to_cpu(sb->max_srq_ext);
+
        bnxt_qplib_query_version(rcfw, attr->fw_ver);
 
        for (i = 0; i < MAX_TQM_ALLOC_REQ / 4; i++) {
index 0ee60fdc18b33edb18f43cc2899e43194ca8886c..7eceb3e9f4ce59d051bc53d70386f2b9d5af8d77 100644 (file)
@@ -2215,11 +2215,12 @@ struct creq_query_func_resp_sb {
        #define CREQ_QUERY_FUNC_RESP_SB_REQ_RETRANSMISSION_SUPPORT_IQM_MSN_TABLE   (0x2UL << 4)
        #define CREQ_QUERY_FUNC_RESP_SB_REQ_RETRANSMISSION_SUPPORT_LAST \
                        CREQ_QUERY_FUNC_RESP_SB_REQ_RETRANSMISSION_SUPPORT_IQM_MSN_TABLE
+       #define CREQ_QUERY_FUNC_RESP_SB_MAX_SRQ_EXTENDED                         0x40UL
        #define CREQ_QUERY_FUNC_RESP_SB_MIN_RNR_RTR_RTS_OPT_SUPPORTED            0x1000UL
        __le16  max_xp_qp_size;
        __le16  create_qp_batch_size;
        __le16  destroy_qp_batch_size;
-       __le16  reserved16;
+       __le16  max_srq_ext;
        __le64  reserved64;
 };