git: 0bff71667441 - main - /sys/dev/bnxt: Enable NPAR support on BCM57504

From: Warner Losh <imp_at_FreeBSD.org>
Date: Sun, 07 Jul 2024 11:52:23 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=0bff716674418ec9f8c48131fb34cafc0af671e8

commit 0bff716674418ec9f8c48131fb34cafc0af671e8
Author:     Vinícius Ferrão <vinicius@ferrao.net.br>
AuthorDate: 2024-06-29 05:16:43 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-07-07 11:49:34 +0000

    /sys/dev/bnxt: Enable NPAR support on BCM57504
    
    This commit enables NPAR support for Broadcom 57504 10/25GbE NICs
    
    Signed-off-by: Vinícius Ferrão <vinicius@ferrao.net.br>
    Reviewed by: imp,ssaxena,nightquick@proton.me
    Pull Request: https://github.com/freebsd/freebsd-src/pull/1306
---
 sys/dev/bnxt/bnxt_en/bnxt.h    | 1 +
 sys/dev/bnxt/bnxt_en/if_bnxt.c | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/sys/dev/bnxt/bnxt_en/bnxt.h b/sys/dev/bnxt/bnxt_en/bnxt.h
index cf4f99077b58..c5fadeafa181 100644
--- a/sys/dev/bnxt/bnxt_en/bnxt.h
+++ b/sys/dev/bnxt/bnxt_en/bnxt.h
@@ -86,6 +86,7 @@
 #define BCM58700	0x16cd
 #define BCM57508  	0x1750
 #define BCM57504  	0x1751
+#define BCM57504_NPAR	0x1801
 #define BCM57502  	0x1752
 #define NETXTREME_C_VF1	0x16cb
 #define NETXTREME_C_VF2	0x16e1
diff --git a/sys/dev/bnxt/bnxt_en/if_bnxt.c b/sys/dev/bnxt/bnxt_en/if_bnxt.c
index 6c0ec892f2c6..00d37f5e0151 100644
--- a/sys/dev/bnxt/bnxt_en/if_bnxt.c
+++ b/sys/dev/bnxt/bnxt_en/if_bnxt.c
@@ -143,6 +143,8 @@ static const pci_vendor_info_t bnxt_vendor_info_array[] =
 	"Broadcom BCM57508 NetXtreme-E 10Gb/25Gb/50Gb/100Gb/200Gb Ethernet"),
     PVID(BROADCOM_VENDOR_ID, BCM57504,
 	"Broadcom BCM57504 NetXtreme-E 10Gb/25Gb/50Gb/100Gb/200Gb Ethernet"),
+    PVID(BROADCOM_VENDOR_ID, BCM57504_NPAR,
+	"Broadcom BCM57504 NetXtreme-E Ethernet Partition"),
     PVID(BROADCOM_VENDOR_ID, BCM57502,
 	"Broadcom BCM57502 NetXtreme-E 10Gb/25Gb/50Gb/100Gb/200Gb Ethernet"),
     PVID(BROADCOM_VENDOR_ID, NETXTREME_C_VF1,
@@ -2087,6 +2089,7 @@ bnxt_attach_pre(if_ctx_t ctx)
 	case BCM57414_NPAR2:
 	case BCM57416_NPAR1:
 	case BCM57416_NPAR2:
+	case BCM57504_NPAR:
 		softc->flags |= BNXT_FLAG_NPAR;
 		break;
 	case NETXTREME_C_VF1:
@@ -2170,6 +2173,7 @@ bnxt_attach_pre(if_ctx_t ctx)
 
 	if ((softc->ver_info->chip_num == BCM57508) ||
 	    (softc->ver_info->chip_num == BCM57504) ||
+	    (softc->ver_info->chip_num == BCM57504_NPAR) ||
 	    (softc->ver_info->chip_num == BCM57502))
 		softc->flags |= BNXT_FLAG_CHIP_P5;