Skip to contentSkip to conversation

net/ring: support secondary process

PATCH Superseded Ferruh Yigit 3 participants 8 messages Sep 30, 2020 – Mar 9, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ring: support secondary process

Also add missing .ini feature list documentation and document some existing features including new "Multiprocess aware" feature.

---
Cc: Kevin Laatz <[email protected]>

---
 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
doc/guides/nics/features/ring.ini new file +10 -0
new file mode 100644
index 0000000000..fbfa6555d7
@@ -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
drivers/net/ring/rte_eth_ring.c +17 -0
index 12046f5a00..f33951ee2e 100644
@@ -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);
Signature · 1 line
2.26.2
#1 lore raw
Quoted 6 lines · Ferruh Yigit

Also add missing .ini feature list documentation and document some existing features including new "Multiprocess aware" feature.

---
Cc: Kevin Laatz <[email protected]>

Hi Bruce,

Reminder of this patch waiting for review.

Thanks,
ferruh

Acked-by on v1 1/1
#2 lore raw
In reply to Ferruh Yigit
Quoted 12 lines · Ferruh Yigit

Also add missing .ini feature list documentation and document some existing features including new "Multiprocess aware" feature.

---
Cc: Kevin Laatz <[email protected]>

---
 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
author Applied
#3 lore raw
Quoted 13 lines · Bruce Richardson
Quoted 12 lines · Ferruh Yigit

Also add missing .ini feature list documentation and document some existing features including new "Multiprocess aware" feature.

---
Cc: Kevin Laatz <[email protected]>

---
  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

Quoted 2 lines

Applied to dpdk-next-net/main, thanks.

#4 lore raw

04/03/2021 18:14, Ferruh Yigit:

Quoted 14 lines · Bruce Richardson
Quoted 13 lines · Ferruh Yigit
Quoted 12 lines

Also add missing .ini feature list documentation and document some existing features including new "Multiprocess aware" feature.

---
Cc: Kevin Laatz <[email protected]>

---
  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

Quoted 4 lines
Quoted 2 lines

Applied to dpdk-next-net/main, thanks.

Sorry, just seeing now.
I think we should not re-introduce the ring PMD in the features table. It is not significant enough to occupy a column in this table I think.

This is the commit where I removed it from the table:
https://git.dpdk.org/dpdk/commit/?id=7b103c4ccd

#5 lore raw
Quoted 18 lines · Thomas Monjalon

04/03/2021 18:14, Ferruh Yigit:

Quoted 17 lines · Bruce Richardson
Quoted 15 lines · Ferruh Yigit
Quoted 12 lines

Also add missing .ini feature list documentation and document some existing features including new "Multiprocess aware" feature.

---
Cc: Kevin Laatz <[email protected]>

---
   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

Quoted 10 lines
Quoted 1 line

Applied to dpdk-next-net/main, thanks.

Sorry, just seeing now.
I think we should not re-introduce the ring PMD in the features table. It is not significant enough to occupy a column in this table I think.

This is the commit where I removed it from the table:
https://git.dpdk.org/dpdk/commit/?id=7b103c4ccd

That is OK, I can send a new version without the .ini file.

#6 lore raw

PATCH v2 1/1 net/ring: support secondary process

In reply to Ferruh Yigit

---
v2:
* Drop .ini file

---
 drivers/net/ring/rte_eth_ring.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
drivers/net/ring/rte_eth_ring.c +17 -0
index 472d838582ee..02f6da2817ba 100644
@@ -615,6 +615,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);
Signature · 1 line
2.29.2