patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH v2 11/11] net/ring: fix dev handle in eth_dev
       [not found] ` <cover.1496235017.git.gaetan.rivet@6wind.com>
@ 2017-05-31 13:17   ` Gaetan Rivet
       [not found]   ` <cover.1496876710.git.gaetan.rivet@6wind.com>
  1 sibling, 0 replies; 2+ messages in thread
From: Gaetan Rivet @ 2017-05-31 13:17 UTC (permalink / raw)
  To: dev; +Cc: Gaetan Rivet, stable, Bruce Richardson

The ring PMD uses special eth_dev allocators, which cannot be updated to
accept an rte_vdev_device.
Circumvent the limitation and store the rte_device handle in the
rte_eth_dev structure.

Fixes: 050fe6e9ff97 ("drivers/net: use ethdev allocation helper for
vdev")
Cc: stable@dpdk.org

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Cc: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/ring/rte_eth_ring.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index 87d2258..9ebc60e 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -515,6 +515,8 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
 	RTE_LOG(INFO, PMD, "Initializing pmd_ring for %s\n", name);
 
 	if (params == NULL || params[0] == '\0') {
+		struct rte_eth_dev *eth_dev;
+
 		ret = eth_dev_ring_create(name, rte_socket_id(), DEV_CREATE);
 		if (ret == -1) {
 			RTE_LOG(INFO, PMD,
@@ -522,6 +524,11 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
 			ret = eth_dev_ring_create(name, rte_socket_id(),
 						  DEV_ATTACH);
 		}
+		/* find an ethdev entry */
+		eth_dev = rte_eth_dev_allocated(name);
+		if (eth_dev == NULL)
+			return -ENODEV;
+		eth_dev->device = &dev->device;
 	}
 	else {
 		kvlist = rte_kvargs_parse(params, valid_arguments);
-- 
2.1.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [dpdk-stable] [PATCH v3 10/10] net/ring: fix dev handle in eth_dev
       [not found]   ` <cover.1496876710.git.gaetan.rivet@6wind.com>
@ 2017-06-07 23:53     ` Gaetan Rivet
  0 siblings, 0 replies; 2+ messages in thread
From: Gaetan Rivet @ 2017-06-07 23:53 UTC (permalink / raw)
  To: dev; +Cc: Gaetan Rivet, stable

The ring PMD uses special eth_dev allocators, which cannot be updated to
accept an rte_vdev_device.
Circumvent the limitation and store the rte_device handle in the
rte_eth_dev structure.

Fixes: 050fe6e9ff97 ("drivers/net: use ethdev allocation helper for
vdev")
Cc: stable@dpdk.org

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
 drivers/net/ring/rte_eth_ring.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index d4dce95..2cd32a9 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -515,6 +515,8 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
 	RTE_LOG(INFO, PMD, "Initializing pmd_ring for %s\n", name);
 
 	if (params == NULL || params[0] == '\0') {
+		struct rte_eth_dev *eth_dev;
+
 		ret = eth_dev_ring_create(name, rte_socket_id(), DEV_CREATE);
 		if (ret == -1) {
 			RTE_LOG(INFO, PMD,
@@ -522,6 +524,11 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
 			ret = eth_dev_ring_create(name, rte_socket_id(),
 						  DEV_ATTACH);
 		}
+		/* find an ethdev entry */
+		eth_dev = rte_eth_dev_allocated(name);
+		if (eth_dev == NULL)
+			return -ENODEV;
+		eth_dev->device = &dev->device;
 	}
 	else {
 		kvlist = rte_kvargs_parse(params, valid_arguments);
-- 
2.1.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-07 23:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1495637723.git.gaetan.rivet@6wind.com>
     [not found] ` <cover.1496235017.git.gaetan.rivet@6wind.com>
2017-05-31 13:17   ` [dpdk-stable] [PATCH v2 11/11] net/ring: fix dev handle in eth_dev Gaetan Rivet
     [not found]   ` <cover.1496876710.git.gaetan.rivet@6wind.com>
2017-06-07 23:53     ` [dpdk-stable] [PATCH v3 10/10] " Gaetan Rivet

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