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

Feifei Wang
2026-03-19T13:53:13Z

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

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

diff --git a/drivers/net/hinic3/base/hinic3_csr.h b/drivers/net/hinic3/base/hinic3_csr.h
index 94b10601c4..eceb34e9fd 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 PCI_VENDOR_ID_HUAWEI 0x19e5
+
+#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_SP920 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..c82b223fa0 100644
--- a/drivers/net/hinic3/base/hinic3_hwif.c
+++ b/drivers/net/hinic3/base/hinic3_hwif.c
@@ -138,7 +138,11 @@

#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)
+static inline bool hinic3_is_vf_dev(const struct rte_pci_device *pdev)
+{
+ return 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)
@@ -552,7 +556,7 @@ hinic3_get_bar_addr(struct hinic3_hwdev *hwdev)
void *db_base = NULL;
int cfg_bar;

- cfg_bar = HINIC3_IS_VF_DEV(pci_dev) ? HINIC3_VF_PCI_CFG_REG_BAR
+ cfg_bar = hinic3_is_vf_dev(pci_dev) ? HINIC3_VF_PCI_CFG_REG_BAR
: HINIC3_PF_PCI_CFG_REG_BAR;
cfg_regs_base = pci_dev->mem_resource[cfg_bar].addr;

@@ -561,7 +565,7 @@ hinic3_get_bar_addr(struct hinic3_hwdev *hwdev)
"mem_resource addr is null, cfg_regs_base is NULL");
return -EFAULT;
}
- if (!HINIC3_IS_VF_DEV(pci_dev)) {
+ if (!hinic3_is_vf_dev(pci_dev)) {
mgmt_reg_base =
pci_dev->mem_resource[HINIC3_PCI_MGMT_REG_BAR].addr;
if (mgmt_reg_base == NULL) {
diff --git a/drivers/net/hinic3/hinic3_ethdev.c b/drivers/net/hinic3/hinic3_ethdev.c
index 0f72728a95..da2d6722d2 100644
--- a/drivers/net/hinic3/hinic3_ethdev.c
+++ b/drivers/net/hinic3/hinic3_ethdev.c
@@ -3521,13 +3521,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_SP920)},

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