git: 15187b27c895 - main - if_bnxt: don't reserve RoCE MSI-x on chips that don't support RoCE

From: Sumit Saxena <ssaxena_at_FreeBSD.org>
Date: Fri, 09 Oct 2026 10:13:04 UTC
The branch main has been updated by ssaxena:

URL: https://cgit.FreeBSD.org/src/commit/?id=15187b27c895e82d153dd1de5324076692023e70

commit 15187b27c895e82d153dd1de5324076692023e70
Author:     Sumit Saxena <sumit.saxena@broadcom.com>
AuthorDate: 2026-08-21 11:33:48 +0000
Commit:     Sumit Saxena <ssaxena@FreeBSD.org>
CommitDate: 2026-10-09 08:24:46 +0000

    if_bnxt: don't reserve RoCE MSI-x on chips that don't support RoCE
    
    RoCE is only supported on Thor and onwards chips.
    bnxt_init_sctx_variants() unconditionally set isc_admin_intrcnt to
    BNXT_ROCE_IRQ_COUNT for every PF device, stealing 9 MSI-x vectors from
    older, non-RoCE-capable chips that will never use them.
    
    Gate the reservation on the device ID: RoCE-capable chips keep
    BNXT_ROCE_IRQ_COUNT, other chips fall back to 1, the baseline
    isc_admin_intrcnt value used before RoCE support (commit 050d28e13cde)
    repurposed it for RoCE MSI-x on every device.
    
    Reviewed by:    gallatin
    MFC after:      2 weeks
    Sponsored by:   Broadcom Inc.
    Differential Revision:  https://reviews.freebsd.org/D59091
---
 sys/dev/bnxt/bnxt_en/if_bnxt.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/sys/dev/bnxt/bnxt_en/if_bnxt.c b/sys/dev/bnxt/bnxt_en/if_bnxt.c
index 62490e86baeb..759eeff63607 100644
--- a/sys/dev/bnxt/bnxt_en/if_bnxt.c
+++ b/sys/dev/bnxt/bnxt_en/if_bnxt.c
@@ -450,6 +450,24 @@ static struct if_shared_ctx bnxt_sctx_pf_init;
 static struct if_shared_ctx bnxt_sctx_vf_init;
 static bool sctx_initialized = false;
 
+static inline bool
+bnxt_device_supports_roce(uint16_t device_id)
+{
+	switch (device_id) {
+	case BCM57508:
+	case BCM57504:
+	case BCM57504_NPAR:
+	case BCM57502:
+	case BCM57601:
+	case BCM57602:
+	case BCM57604:
+	case BCM57608:
+		return true;
+	default:
+		return false;
+	}
+}
+
 static inline void
 bnxt_init_sctx_variants(uint16_t device_id)
 {
@@ -458,7 +476,8 @@ bnxt_init_sctx_variants(uint16_t device_id)
     else
 	bnxt_sctx_pf_init = bnxt_sctx_template;
 
-    bnxt_sctx_pf_init.isc_admin_intrcnt = BNXT_ROCE_IRQ_COUNT;
+    bnxt_sctx_pf_init.isc_admin_intrcnt = bnxt_device_supports_roce(device_id) ?
+	BNXT_ROCE_IRQ_COUNT : 1;
     if (device_id == BCM57608)
 	bnxt_sctx_pf_init.isc_admin_intrcnt += BNXT_MAX_MPC;