From: Wenbo Cao <caowenbo@mucse.com>
To: thomas@monjalon.net, Wenbo Cao <caowenbo@mucse.com>
Cc: stephen@networkplumber.org, dev@dpdk.org, ferruh.yigit@amd.com,
andrew.rybchenko@oktetlabs.ru, yaojun@mucse.com
Subject: [PATCH v13 02/28] net/rnp: add ethdev probe and remove
Date: Wed, 19 Feb 2025 15:57:03 +0800 [thread overview]
Message-ID: <1739951849-67601-3-git-send-email-caowenbo@mucse.com> (raw)
In-Reply-To: <1739951849-67601-1-git-send-email-caowenbo@mucse.com>
Add basic PCIe ethdev probe and remove.
Signed-off-by: Wenbo Cao <caowenbo@mucse.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
---
doc/guides/nics/rnp.rst | 17 ++++++++++
drivers/net/rnp/rnp.h | 16 +++++++++
drivers/net/rnp/rnp_ethdev.c | 66 ++++++++++++++++++++++++++++++++++++
3 files changed, 99 insertions(+)
create mode 100644 drivers/net/rnp/rnp.h
diff --git a/doc/guides/nics/rnp.rst b/doc/guides/nics/rnp.rst
index b76c60349c..cca249be78 100644
--- a/doc/guides/nics/rnp.rst
+++ b/doc/guides/nics/rnp.rst
@@ -14,6 +14,23 @@ Supported Chipsets and NICs
- MUCSE Ethernet Controller N10 Series for 10GbE or 40GbE (Dual-port)
+Support of Ethernet Network Controllers
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+PCIE NICS
+^^^^^^^^^
+
+* ``N10G-X2-DC .... Dual-port 10 Gigabit SFP Ethernet Adapter``
+* ``N10G-X4-QC .... Quad-port 10 Gigabit SFP Ethernet Adapter``
+* ``N10G-X8-DC .... Octa-port 10 Gigabit SFP Ethernet Adapter``
+
+OCP 3.0 NICs
+^^^^^^^^^^^^
+
+* ``N10G-X2-DCP .... Dual-port 10 Gigabit SFP Ethernet Adapter``
+* ``N10G-X4-DCP .... Dual-port 10 Gigabit SFP Ethernet Adapter``
+* ``N10G-X8-DCP .... Dual-port 10 Gigabit SFP Ethernet Adapter``
+
Chip Basic Overview
-------------------
N10 has two functions, each function support muiple ports(1 to 8),which not same as normal pcie network card(one pf for each port).
diff --git a/drivers/net/rnp/rnp.h b/drivers/net/rnp/rnp.h
new file mode 100644
index 0000000000..4413a03d9d
--- /dev/null
+++ b/drivers/net/rnp/rnp.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2023 Mucse IC Design Ltd.
+ */
+
+#ifndef __RNP_H__
+#define __RNP_H__
+
+#define PCI_VENDOR_ID_MUCSE (0x8848)
+#define RNP_DEV_ID_N10G_X2 (0x1000)
+#define RNP_DEV_ID_N10G_X4 (0x1020)
+#define RNP_DEV_ID_N10G_X8 (0x1060)
+
+struct rnp_eth_port {
+};
+
+#endif /* __RNP_H__ */
diff --git a/drivers/net/rnp/rnp_ethdev.c b/drivers/net/rnp/rnp_ethdev.c
index 9ce3c0b497..e2eb80ba69 100644
--- a/drivers/net/rnp/rnp_ethdev.c
+++ b/drivers/net/rnp/rnp_ethdev.c
@@ -1,3 +1,69 @@
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(C) 2023 Mucse IC Design Ltd.
*/
+
+#include <ethdev_pci.h>
+#include <rte_io.h>
+
+#include "rnp.h"
+
+static int
+rnp_eth_dev_init(struct rte_eth_dev *eth_dev)
+{
+ RTE_SET_USED(eth_dev);
+
+ return -ENODEV;
+}
+
+static int
+rnp_eth_dev_uninit(struct rte_eth_dev *eth_dev)
+{
+ RTE_SET_USED(eth_dev);
+
+ return -ENODEV;
+}
+
+static int
+rnp_pci_remove(struct rte_pci_device *pci_dev)
+{
+ struct rte_eth_dev *eth_dev;
+
+ eth_dev = rte_eth_dev_allocated(pci_dev->device.name);
+
+ if (eth_dev)
+ /* Cleanup eth dev */
+ return rte_eth_dev_pci_generic_remove(pci_dev,
+ rnp_eth_dev_uninit);
+ return -ENODEV;
+}
+
+static int
+rnp_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
+{
+ int rc;
+
+ RTE_SET_USED(pci_drv);
+
+ rc = rte_eth_dev_pci_generic_probe(pci_dev, sizeof(struct rnp_eth_port),
+ rnp_eth_dev_init);
+
+ return rc;
+}
+
+static const struct rte_pci_id pci_id_rnp_map[] = {
+ { RTE_PCI_DEVICE(PCI_VENDOR_ID_MUCSE, RNP_DEV_ID_N10G_X2) },
+ { RTE_PCI_DEVICE(PCI_VENDOR_ID_MUCSE, RNP_DEV_ID_N10G_X4) },
+ { RTE_PCI_DEVICE(PCI_VENDOR_ID_MUCSE, RNP_DEV_ID_N10G_X8) },
+ { .vendor_id = 0, },
+};
+
+static struct rte_pci_driver rte_rnp_pmd = {
+ .id_table = pci_id_rnp_map,
+ .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
+ .probe = rnp_pci_probe,
+ .remove = rnp_pci_remove,
+};
+
+RTE_PMD_REGISTER_PCI(net_rnp, rte_rnp_pmd);
+RTE_PMD_REGISTER_PCI_TABLE(net_rnp, pci_id_rnp_map);
+RTE_PMD_REGISTER_KMOD_DEP(net_rnp, "igb_uio | uio_pci_generic | vfio-pci");
--
2.25.1
next prev parent reply other threads:[~2025-02-19 7:58 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-19 7:57 [PATCH v13 00/28] [v13]drivers/net Add Support mucse N10 Pmd Driver Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 01/28] net/rnp: add skeleton Wenbo Cao
2025-02-19 7:57 ` Wenbo Cao [this message]
2025-02-19 7:57 ` [PATCH v13 03/28] net/rnp: add log Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 04/28] net/rnp: support mailbox basic operate Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 05/28] net/rnp: add device init and uninit Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 06/28] net/rnp: add get device information operation Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 07/28] net/rnp: add support MAC promisc mode Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 08/28] net/rnp: add queue setup and release operations Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 09/28] net/rnp: add queue stop and start operations Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 10/28] net/rnp: add support device start stop operations Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 11/28] net/rnp: add RSS support operations Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 12/28] net/rnp: add support link update operations Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 13/28] net/rnp: add support link setup operations Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 14/28] net/rnp: add Rx burst simple support Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 15/28] net/rnp: add Tx " Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 16/28] net/rnp: add MTU set operation Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 17/28] net/rnp: add Rx scatter segment version Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 18/28] net/rnp: add Tx multiple " Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 19/28] net/rnp: add support basic stats operation Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 20/28] net/rnp: add support xstats operation Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 21/28] net/rnp: add unicast MAC filter operation Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 22/28] net/rnp: add supported packet types Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 23/28] net/rnp: add support Rx checksum offload Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 24/28] net/rnp: add support Tx TSO offload Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 25/28] net/rnp: support VLAN offloads Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 26/28] net/rnp: add support VLAN filters operations Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 27/28] net/rnp: add queue info operation Wenbo Cao
2025-02-19 7:57 ` [PATCH v13 28/28] net/rnp: support Rx/Tx burst mode info Wenbo Cao
2025-02-19 16:14 ` [PATCH v13 00/28] [v13]drivers/net Add Support mucse N10 Pmd Driver Stephen Hemminger
2025-02-20 5:06 ` 11
2025-02-20 17:44 ` Stephen Hemminger
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=1739951849-67601-3-git-send-email-caowenbo@mucse.com \
--to=caowenbo@mucse.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
--cc=yaojun@mucse.com \
/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).