[dpdk-stable] patch 'net/ring: fix device pointer on allocation' has been queued to LTS release 18.11.9

Kevin Traynor ktraynor at redhat.com
Fri Jun 5 20:24:40 CEST 2020


Hi,

FYI, your patch has been queued to LTS release 18.11.9

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/10/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/160d1b6410cd4db1ec84dba0038f377605741c4f

Thanks.

Kevin.

---
>From 160d1b6410cd4db1ec84dba0038f377605741c4f Mon Sep 17 00:00:00 2001
From: Gaetan Rivet <grive at u256.net>
Date: Wed, 6 May 2020 20:09:49 +0200
Subject: [PATCH] net/ring: fix device pointer on allocation

[ upstream commit 8459f5ab32211fb10bbfe388fa0e017475d8507c ]

When a net_ring device is allocated, its device pointer is not set
before calling rte_eth_dev_probing_finish, which is incorrect.

The following:
  commit 96cb19521147 ("net/ring: use EAL APIs in PMD specific API")
  commit a6992e961050 ("net/ring: set ethernet device field")

already fixed the same issue in 17.08, which was fine at the time.
Adding the hook rte_eth_dev_probing_finish() however created this bug,
as the eth_dev exposed when this hook is executed is expected to be
complete.

Remove the prior attempts to fix the issue in rte_pmd_ring_probe() and
write the pointer properly in do_eth_dev_ring_create().

Fixes: fbe90cdd776c ("ethdev: add probing finish function")

Signed-off-by: Gaetan Rivet <grive at u256.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
 drivers/net/ring/rte_eth_ring.c | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index 452114d0c5..7298ee93e2 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -252,4 +252,5 @@ static const struct eth_dev_ops ops = {
 static int
 do_eth_dev_ring_create(const char *name,
+		struct rte_vdev_device *vdev,
 		struct rte_ring * const rx_queues[],
 		const unsigned int nb_rx_queues,
@@ -297,4 +298,5 @@ do_eth_dev_ring_create(const char *name,
 
 	/* now put it all together
+	 * - store EAL device in eth_dev,
 	 * - store queue data in internals,
 	 * - store numa_node info in eth_dev_data
@@ -303,4 +305,6 @@ do_eth_dev_ring_create(const char *name,
 	 */
 
+	eth_dev->device = &vdev->device;
+
 	data = eth_dev->data;
 	data->rx_queues = rx_queues_local;
@@ -412,5 +416,7 @@ rte_eth_from_ring(struct rte_ring *r)
 
 static int
-eth_dev_ring_create(const char *name, const unsigned int numa_node,
+eth_dev_ring_create(const char *name,
+		struct rte_vdev_device *vdev,
+		const unsigned int numa_node,
 		enum dev_action action, struct rte_eth_dev **eth_dev)
 {
@@ -442,5 +448,5 @@ eth_dev_ring_create(const char *name, const unsigned int numa_node,
 	}
 
-	if (do_eth_dev_ring_create(name, rxtx, num_rings, rxtx, num_rings,
+	if (do_eth_dev_ring_create(name, vdev, rxtx, num_rings, rxtx, num_rings,
 		numa_node, action, eth_dev) < 0)
 		return -1;
@@ -563,10 +569,10 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
 
 	if (params == NULL || params[0] == '\0') {
-		ret = eth_dev_ring_create(name, rte_socket_id(), DEV_CREATE,
+		ret = eth_dev_ring_create(name, dev, rte_socket_id(), DEV_CREATE,
 				&eth_dev);
 		if (ret == -1) {
 			PMD_LOG(INFO,
 				"Attach to pmd_ring for %s", name);
-			ret = eth_dev_ring_create(name, rte_socket_id(),
+			ret = eth_dev_ring_create(name, dev, rte_socket_id(),
 						  DEV_ATTACH, &eth_dev);
 		}
@@ -577,5 +583,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
 			PMD_LOG(INFO,
 				"Ignoring unsupported parameters when creatingrings-backed ethernet device");
-			ret = eth_dev_ring_create(name, rte_socket_id(),
+			ret = eth_dev_ring_create(name, dev, rte_socket_id(),
 						  DEV_CREATE, &eth_dev);
 			if (ret == -1) {
@@ -583,11 +589,8 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
 					"Attach to pmd_ring for %s",
 					name);
-				ret = eth_dev_ring_create(name, rte_socket_id(),
+				ret = eth_dev_ring_create(name, dev, rte_socket_id(),
 							  DEV_ATTACH, &eth_dev);
 			}
 
-			if (eth_dev)
-				eth_dev->device = &dev->device;
-
 			return ret;
 		}
@@ -600,5 +603,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
 				goto out_free;
 
-			ret = do_eth_dev_ring_create(name,
+			ret = do_eth_dev_ring_create(name, dev,
 				internal_args->rx_queues,
 				internal_args->nb_rx_queues,
@@ -630,4 +633,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
 			for (info->count = 0; info->count < info->total; info->count++) {
 				ret = eth_dev_ring_create(info->list[info->count].name,
+							  dev,
 							  info->list[info->count].node,
 							  info->list[info->count].action,
@@ -638,5 +642,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
 						"Attach to pmd_ring for %s",
 						name);
-					ret = eth_dev_ring_create(name,
+					ret = eth_dev_ring_create(name, dev,
 							info->list[info->count].node,
 							DEV_ATTACH,
@@ -647,7 +651,4 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
 	}
 
-	if (eth_dev)
-		eth_dev->device = &dev->device;
-
 out_free:
 	rte_kvargs_free(kvlist);
-- 
2.21.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-06-05 19:20:53.200289319 +0100
+++ 0043-net-ring-fix-device-pointer-on-allocation.patch	2020-06-05 19:20:50.820040586 +0100
@@ -1 +1 @@
-From 8459f5ab32211fb10bbfe388fa0e017475d8507c Mon Sep 17 00:00:00 2001
+From 160d1b6410cd4db1ec84dba0038f377605741c4f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8459f5ab32211fb10bbfe388fa0e017475d8507c ]
+
@@ -22 +23,0 @@
-Cc: stable at dpdk.org
@@ -31 +32 @@
-index 41acbc513d..f0fafa0c0d 100644
+index 452114d0c5..7298ee93e2 100644
@@ -34 +35 @@
-@@ -247,4 +247,5 @@ static const struct eth_dev_ops ops = {
+@@ -252,4 +252,5 @@ static const struct eth_dev_ops ops = {
@@ -40 +41 @@
-@@ -292,4 +293,5 @@ do_eth_dev_ring_create(const char *name,
+@@ -297,4 +298,5 @@ do_eth_dev_ring_create(const char *name,
@@ -46 +47 @@
-@@ -298,4 +300,6 @@ do_eth_dev_ring_create(const char *name,
+@@ -303,4 +305,6 @@ do_eth_dev_ring_create(const char *name,
@@ -53 +54 @@
-@@ -409,5 +413,7 @@ rte_eth_from_ring(struct rte_ring *r)
+@@ -412,5 +416,7 @@ rte_eth_from_ring(struct rte_ring *r)
@@ -62 +63 @@
-@@ -439,5 +445,5 @@ eth_dev_ring_create(const char *name, const unsigned int numa_node,
+@@ -442,5 +448,5 @@ eth_dev_ring_create(const char *name, const unsigned int numa_node,
@@ -69 +70 @@
-@@ -561,10 +567,10 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
+@@ -563,10 +569,10 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
@@ -82 +83 @@
-@@ -575,5 +581,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
+@@ -577,5 +583,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
@@ -89 +90 @@
-@@ -581,11 +587,8 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
+@@ -583,11 +589,8 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
@@ -102 +103 @@
-@@ -598,5 +601,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
+@@ -600,5 +603,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
@@ -109 +110 @@
-@@ -628,4 +631,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
+@@ -630,4 +633,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
@@ -115 +116 @@
-@@ -636,5 +640,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
+@@ -638,5 +642,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
@@ -122 +123 @@
-@@ -645,7 +649,4 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
+@@ -647,7 +651,4 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)



More information about the stable mailing list