git: 5d924d6cc041 - stable/15 - if_bnxt: Support backing store v2 for Thor if FW supports it

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Thu, 29 Oct 2026 23:37:07 UTC
The branch stable/15 has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=5d924d6cc041e9b69e2c93aa5711049f7418e049

commit 5d924d6cc041e9b69e2c93aa5711049f7418e049
Author:     Sreekanth Reddy <sreekanth.reddy@broadcom.com>
AuthorDate: 2026-07-21 06:55:15 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-10-29 23:15:18 +0000

    if_bnxt: Support backing store v2 for Thor if FW supports it
    
    The driver currently only supports BS v1 for Thor even though the
    firmware supports v2, capping max_mr at ~192K when firmware can
    support up to ~256K. Enable Backing Store v2 support for the Thor controller.
    
    Reviewed by:    gallatin
    Sponsored by:   Broadcom Inc.
    Differential Revision:  https://reviews.freebsd.org/D58601
    
    (cherry picked from commit 4c293e01fd2a8a3adb3fbac12e7ce40db84ed734)
---
 sys/dev/bnxt/bnxt_en/bnxt_hwrm.c | 9 ++++-----
 sys/dev/bnxt/bnxt_en/if_bnxt.c   | 8 +++-----
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c
index 098f5e00c50b..a7a4422c4245 100644
--- a/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c
+++ b/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c
@@ -490,10 +490,8 @@ int bnxt_hwrm_func_backing_store_qcaps(struct bnxt_softc *softc)
 	if (softc->hwrm_spec_code < 0x10902 || softc->ctx_mem)
 		return 0;
 
-	if (BNXT_CHIP_P7(softc)) {
-		if (softc->fw_cap & BNXT_FW_CAP_BACKING_STORE_V2)
-			return bnxt_hwrm_func_backing_store_qcaps_v2(softc);
-	}
+	if (softc->fw_cap & BNXT_FW_CAP_BACKING_STORE_V2)
+		return bnxt_hwrm_func_backing_store_qcaps_v2(softc);
 
 	if (BNXT_VF(softc))
 		return 0;
@@ -1289,7 +1287,8 @@ bnxt_hwrm_func_qcaps(struct bnxt_softc *softc)
 	    flags_ext & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_DBR_PACING_SUPPORTED)
 		softc->fw_cap |= BNXT_FW_CAP_DBR_PACING_SUPPORTED;
 
-	if (flags_ext2 & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_SW_MAX_RESOURCE_LIMITS_SUPPORTED)
+	if (BNXT_CHIP_P5_PLUS(softc) &&
+	    flags_ext2 & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_SW_MAX_RESOURCE_LIMITS_SUPPORTED)
 		softc->fw_cap |= BNXT_FW_CAP_SW_MAX_RESOURCE_LIMITS;
 
 	if (flags_ext2 & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_GENERIC_STATS_SUPPORTED)
diff --git a/sys/dev/bnxt/bnxt_en/if_bnxt.c b/sys/dev/bnxt/bnxt_en/if_bnxt.c
index b1bf8837a1ef..0e10bfbc51f4 100644
--- a/sys/dev/bnxt/bnxt_en/if_bnxt.c
+++ b/sys/dev/bnxt/bnxt_en/if_bnxt.c
@@ -1507,12 +1507,10 @@ skip_rdma:
 	ena |= HWRM_FUNC_BACKING_STORE_CFG_INPUT_DFLT_ENABLES;
 
 skip_legacy:
-	if (BNXT_CHIP_P7(softc)) {
-		if (softc->fw_cap & BNXT_FW_CAP_BACKING_STORE_V2)
-			rc = bnxt_backing_store_cfg_v2(softc, ena);
-	} else {
+	if (softc->fw_cap & BNXT_FW_CAP_BACKING_STORE_V2)
+		rc = bnxt_backing_store_cfg_v2(softc, ena);
+	else
 		rc = bnxt_hwrm_func_backing_store_cfg(softc, ena);
-	}
 	if (rc) {
 		device_printf(softc->dev, "Failed configuring context mem, rc = %d.\n",
 			      rc);