From: Junlong Wang <wang.junlong1@zte.com.cn>
To: stephen@networkplumber.org
Cc: dev@dpdk.org, Junlong Wang <wang.junlong1@zte.com.cn>
Subject: [PATCH v1] net/zxdh: add support E31X series device ID
Date: Tue, 15 Apr 2025 16:42:26 +0800 [thread overview]
Message-ID: <20250415084227.443617-1-wang.junlong1@zte.com.cn> (raw)
In-Reply-To: <20250409013955.133122-1-wang.junlong1@zte.com.cn>
[-- Attachment #1.1.1: Type: text/plain, Size: 3135 bytes --]
add support e312s、e316、e310_rdma、e312_rdma device id.
Signed-off-by: Junlong Wang <wang.junlong1@zte.com.cn>
---
drivers/net/zxdh/zxdh_ethdev.c | 23 ++++++++++++++++++++---
drivers/net/zxdh/zxdh_ethdev.h | 13 +++++++++++--
2 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/drivers/net/zxdh/zxdh_ethdev.c b/drivers/net/zxdh/zxdh_ethdev.c
index a0cea32b87..80053678cb 100644
--- a/drivers/net/zxdh/zxdh_ethdev.c
+++ b/drivers/net/zxdh/zxdh_ethdev.c
@@ -1982,6 +1982,17 @@ zxdh_priv_res_free(struct zxdh_hw *priv)
}
}
+static uint8_t
+is_pf(uint16_t device_id)
+{
+ return (device_id == ZXDH_E310_PF_DEVICEID ||
+ device_id == ZXDH_E312_PF_DEVICEID ||
+ device_id == ZXDH_E312S_PF_DEVICEID ||
+ device_id == ZXDH_E316_PF_DEVICEID ||
+ device_id == ZXDH_E310_RDMA_PF_DEVICEID ||
+ device_id == ZXDH_E312_RDMA_PF_DEVICEID);
+}
+
static int
zxdh_eth_dev_init(struct rte_eth_dev *eth_dev)
{
@@ -2015,10 +2026,8 @@ zxdh_eth_dev_init(struct rte_eth_dev *eth_dev)
hw->slot_id = ZXDH_INVALID_SLOT_IDX;
hw->is_pf = 0;
- if (pci_dev->id.device_id == ZXDH_E310_PF_DEVICEID ||
- pci_dev->id.device_id == ZXDH_E312_PF_DEVICEID) {
+ if (is_pf(pci_dev->id.device_id))
hw->is_pf = 1;
- }
ret = zxdh_init_once(eth_dev);
if (ret != 0)
@@ -2114,6 +2123,14 @@ static const struct rte_pci_id pci_id_zxdh_map[] = {
{RTE_PCI_DEVICE(ZXDH_PCI_VENDOR_ID, ZXDH_E310_VF_DEVICEID)},
{RTE_PCI_DEVICE(ZXDH_PCI_VENDOR_ID, ZXDH_E312_PF_DEVICEID)},
{RTE_PCI_DEVICE(ZXDH_PCI_VENDOR_ID, ZXDH_E312_VF_DEVICEID)},
+ {RTE_PCI_DEVICE(ZXDH_PCI_VENDOR_ID, ZXDH_E312S_PF_DEVICEID)},
+ {RTE_PCI_DEVICE(ZXDH_PCI_VENDOR_ID, ZXDH_E312S_VF_DEVICEID)},
+ {RTE_PCI_DEVICE(ZXDH_PCI_VENDOR_ID, ZXDH_E316_PF_DEVICEID)},
+ {RTE_PCI_DEVICE(ZXDH_PCI_VENDOR_ID, ZXDH_E316_VF_DEVICEID)},
+ {RTE_PCI_DEVICE(ZXDH_PCI_VENDOR_ID, ZXDH_E310_RDMA_PF_DEVICEID)},
+ {RTE_PCI_DEVICE(ZXDH_PCI_VENDOR_ID, ZXDH_E310_RDMA_VF_DEVICEID)},
+ {RTE_PCI_DEVICE(ZXDH_PCI_VENDOR_ID, ZXDH_E312_RDMA_PF_DEVICEID)},
+ {RTE_PCI_DEVICE(ZXDH_PCI_VENDOR_ID, ZXDH_E312_RDMA_VF_DEVICEID)},
{.vendor_id = 0, /* sentinel */ },
};
static struct rte_pci_driver zxdh_pmd = {
diff --git a/drivers/net/zxdh/zxdh_ethdev.h b/drivers/net/zxdh/zxdh_ethdev.h
index 261acd17c3..169af209a2 100644
--- a/drivers/net/zxdh/zxdh_ethdev.h
+++ b/drivers/net/zxdh/zxdh_ethdev.h
@@ -17,8 +17,17 @@
#define ZXDH_E310_PF_DEVICEID 0x8061
#define ZXDH_E310_VF_DEVICEID 0x8062
-#define ZXDH_E312_PF_DEVICEID 0x8049
-#define ZXDH_E312_VF_DEVICEID 0x8060
+#define ZXDH_E312_PF_DEVICEID 0x80a0
+#define ZXDH_E312_VF_DEVICEID 0x80a1
+#define ZXDH_E312S_PF_DEVICEID 0x807d
+#define ZXDH_E312S_VF_DEVICEID 0x8088
+#define ZXDH_E316_PF_DEVICEID 0x807e
+#define ZXDH_E316_VF_DEVICEID 0x807f
+
+#define ZXDH_E310_RDMA_PF_DEVICEID 0x8084
+#define ZXDH_E310_RDMA_VF_DEVICEID 0x8085
+#define ZXDH_E312_RDMA_PF_DEVICEID 0x8049
+#define ZXDH_E312_RDMA_VF_DEVICEID 0x8060
#define ZXDH_MAX_UC_MAC_ADDRS 32
#define ZXDH_MAX_MC_MAC_ADDRS 32
--
2.27.0
[-- Attachment #1.1.2: Type: text/html , Size: 5647 bytes --]
prev parent reply other threads:[~2025-04-15 8:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-09 1:39 [PATCH v1] net/zxdh: fix using static assert in macro definition Junlong Wang
2025-04-15 8:42 ` Junlong Wang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250415084227.443617-1-wang.junlong1@zte.com.cn \
--to=wang.junlong1@zte.com.cn \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).