net/ring: support secondary process
diff mbox series

Message ID 20200930110241.1882308-1-ferruh.yigit@intel.com
State New
Delegated to: Ferruh Yigit
Headers show
Series
  • net/ring: support secondary process
Related show

Checks

Context Check Description
ci/travis-robot success Travis build: passed
ci/iol-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Ferruh Yigit Sept. 30, 2020, 11:02 a.m. UTC
Also add missing .ini feature list documentation and document some
existing features including new "Multiprocess aware" feature.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: Kevin Laatz <kevin.laatz@intel.com>
---
 doc/guides/nics/features/ring.ini | 10 ++++++++++
 drivers/net/ring/rte_eth_ring.c   | 17 +++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 doc/guides/nics/features/ring.ini

Patch
diff mbox series

diff --git a/doc/guides/nics/features/ring.ini b/doc/guides/nics/features/ring.ini
new file mode 100644
index 0000000000..fbfa6555d7
--- /dev/null
+++ b/doc/guides/nics/features/ring.ini
@@ -0,0 +1,10 @@ 
+;
+; Supported features of the 'ring' network poll mode driver.
+;
+; Refer to default.ini for the full list of available PMD features.
+;
+[Features]
+Basic stats          = Y
+Multiprocess aware   = Y
+ARMv8                = Y
+x86-64               = Y
diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index 12046f5a00..f33951ee2e 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -595,6 +595,23 @@  rte_pmd_ring_probe(struct rte_vdev_device *dev)
 
 	PMD_LOG(INFO, "Initializing pmd_ring for %s", name);
 
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
+		eth_dev = rte_eth_dev_attach_secondary(name);
+		if (!eth_dev) {
+			PMD_LOG(ERR, "Failed to probe %s", name);
+			return -1;
+		}
+		eth_dev->dev_ops = &ops;
+		eth_dev->device = &dev->device;
+
+		eth_dev->rx_pkt_burst = eth_ring_rx;
+		eth_dev->tx_pkt_burst = eth_ring_tx;
+
+		rte_eth_dev_probing_finish(eth_dev);
+
+		return 0;
+	}
+
 	if (params == NULL || params[0] == '\0') {
 		ret = eth_dev_ring_create(name, dev, rte_socket_id(), DEV_CREATE,
 				&eth_dev);