[PATCH 1/7] net/hinic3: add support for new SPx series NIC

Feifei Wang
2026-01-31T10:06:47Z

Add new device id to suuport Huawei new SPx series Network Adapters.

Signed-off-by: Feifei Wang <wangfeifei40@huawei.com>
---
drivers/net/hinic3/base/hinic3_csr.h | 16 ++++++++--------
drivers/net/hinic3/base/hinic3_hwif.c | 4 +++-
drivers/net/hinic3/hinic3_ethdev.c | 14 +++++++-------
3 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/drivers/net/hinic3/base/hinic3_csr.h b/drivers/net/hinic3/base/hinic3_csr.h
index 94b10601c4..e601ffafa7 100644
--- a/drivers/net/hinic3/base/hinic3_csr.h
+++ b/drivers/net/hinic3/base/hinic3_csr.h
@@ -5,15 +5,15 @@
#ifndef _HINIC3_CSR_H_
#define _HINIC3_CSR_H_

-#ifdef CONFIG_SP_VID_DID
-#define PCI_VENDOR_ID_SPNIC 0x1F3F
-#define HINIC3_DEV_ID_STANDARD 0x9020
-#define HINIC3_DEV_ID_VF 0x9001
-#else
#define PCI_VENDOR_ID_HUAWEI 0x19e5
-#define HINIC3_DEV_ID_STANDARD 0x0222
-#define HINIC3_DEV_ID_VF 0x375F
-#endif
+
+#define HINIC3_DEV_ID_SP620 0x0222
+#define HINIC3_DEV_ID_VF_SP620 0x375F
+
+#define HINIC3_DEV_ID_SP230 0X0229
+#define HINIC3_DEV_ID_VF_SP230 0x3750
+
+#define HINIC3_DEV_ID_920 0x0224

/*
* Bit30/bit31 for bar index flag.
diff --git a/drivers/net/hinic3/base/hinic3_hwif.c b/drivers/net/hinic3/base/hinic3_hwif.c
index 080254bf44..24afec3d1b 100644
--- a/drivers/net/hinic3/base/hinic3_hwif.c
+++ b/drivers/net/hinic3/base/hinic3_hwif.c
@@ -138,7 +138,9 @@

#define HINIC3_GET_REG_ADDR(reg) ((reg) & (HINIC3_REGS_FLAG_MASK))

-#define HINIC3_IS_VF_DEV(pdev) ((pdev)->id.device_id == HINIC3_DEV_ID_VF)
+#define HINIC3_IS_VF_DEV(pdev) ( \
+ (pdev)->id.device_id == HINIC3_DEV_ID_VF_SP620 || \
+ (pdev)->id.device_id == HINIC3_DEV_ID_VF_SP230)

uint32_t
hinic3_hwif_read_reg(struct hinic3_hwif *hwif, uint32_t reg)
diff --git a/drivers/net/hinic3/hinic3_ethdev.c b/drivers/net/hinic3/hinic3_ethdev.c
index 0e25175ba1..a5116264b0 100644
--- a/drivers/net/hinic3/hinic3_ethdev.c
+++ b/drivers/net/hinic3/hinic3_ethdev.c
@@ -3525,13 +3525,13 @@ hinic3_dev_uninit(struct rte_eth_dev *dev)
}

static const struct rte_pci_id pci_id_hinic3_map[] = {
-#ifdef CONFIG_SP_VID_DID
- {RTE_PCI_DEVICE(PCI_VENDOR_ID_SPNIC, HINIC3_DEV_ID_STANDARD)},
- {RTE_PCI_DEVICE(PCI_VENDOR_ID_SPNIC, HINIC3_DEV_ID_VF)},
-#else
- {RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HINIC3_DEV_ID_STANDARD)},
- {RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HINIC3_DEV_ID_VF)},
-#endif
+ {RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HINIC3_DEV_ID_SP620)},
+ {RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HINIC3_DEV_ID_VF_SP620)},
+
+ {RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HINIC3_DEV_ID_SP230)},
+ {RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HINIC3_DEV_ID_VF_SP230)},
+
+ {RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HINIC3_DEV_ID_VF_SP920)},

{.vendor_id = 0},
};
--
2.45.1.windows.1