patch 'net/ring: remove internal devarg' has been queued to stable release 24.11.9

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue Oct 27 12:49:06 CET 2026


Hi,

FYI, your patch has been queued to stable release 24.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 10/29/26. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/11bb037bd349d10cfa00dcd2c33dceb037879c97

Thanks.

Luca Boccassi

---
>From 11bb037bd349d10cfa00dcd2c33dceb037879c97 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson at intel.com>
Date: Tue, 22 Sep 2026 15:24:11 +0100
Subject: [PATCH] net/ring: remove internal devarg

[ upstream commit e26eb3c0c0a6e33b60b54a82ce237a4ed6abd1b1 ]

The devarg "internal" was used to pass a pointer to the creation
function to reuse set parameters. However, this meant it could also be
used as a devarg on the commandline leading to incorrect behaviour.
Redesign the passing of the args parameters to use a per-thread global
instead. The wrapper function sets the global to a valid value before
calling the main creation function, skipping passing a devarg, before
resetting the pointer back to NULL when the function returns.

Bugzilla ID: 1687
Fixes: 96cb19521147 ("net/ring: use EAL APIs in PMD specific API")

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
---
 drivers/net/ring/rte_eth_ring.c | 137 ++++++++++++--------------------
 1 file changed, 50 insertions(+), 87 deletions(-)

diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index 146bdc8e029..32ed569e704 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -10,6 +10,7 @@
 #include <rte_malloc.h>
 #include <rte_memcpy.h>
 #include <rte_os_shim.h>
+#include <rte_per_lcore.h>
 #include <rte_string_fns.h>
 #include <bus_vdev_driver.h>
 #include <rte_kvargs.h>
@@ -19,12 +20,9 @@
 #define ETH_RING_ACTION_CREATE		"CREATE"
 #define ETH_RING_ACTION_ATTACH		"ATTACH"
 #define ETH_RING_ACTION_MAX_LEN		8 /* CREATE | ACTION */
-#define ETH_RING_INTERNAL_ARG		"internal"
-#define ETH_RING_INTERNAL_ARG_MAX_LEN	19 /* "0x..16chars..\0" */
 
 static const char *valid_arguments[] = {
 	ETH_RING_NUMA_NODE_ACTION_ARG,
-	ETH_RING_INTERNAL_ARG,
 	NULL
 };
 
@@ -34,9 +32,11 @@ struct ring_internal_args {
 	struct rte_ring * const *tx_queues;
 	const unsigned int nb_tx_queues;
 	const unsigned int numa_node;
-	void *addr; /* self addr for sanity check */
 };
 
+/* rte_eth_from_rings() stashes a pointer to its on-stack args here */
+static RTE_DEFINE_PER_LCORE(struct ring_internal_args *, eth_ring_internal_args);
+
 enum dev_action {
 	DEV_CREATE,
 	DEV_ATTACH
@@ -469,9 +469,7 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[],
 		.tx_queues = tx_queues,
 		.nb_tx_queues = nb_tx_queues,
 		.numa_node = numa_node,
-		.addr = &args,
 	};
-	char args_str[32];
 	char ring_name[RTE_RING_NAMESIZE];
 	uint16_t port_id = RTE_MAX_ETHPORTS;
 	int ret;
@@ -490,16 +488,16 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[],
 		return -1;
 	}
 
-	snprintf(args_str, sizeof(args_str), "%s=%p",
-		 ETH_RING_INTERNAL_ARG, &args);
-
 	ret = snprintf(ring_name, sizeof(ring_name), "net_ring_%s", name);
 	if (ret >= (int)sizeof(ring_name)) {
 		rte_errno = ENAMETOOLONG;
 		return -1;
 	}
 
-	ret = rte_vdev_init(ring_name, args_str);
+	/* mark this thread's pending request; consumed and cleared by probe */
+	RTE_PER_LCORE(eth_ring_internal_args) = &args;
+	ret = rte_vdev_init(ring_name, NULL);
+	RTE_PER_LCORE(eth_ring_internal_args) = NULL;
 	if (ret) {
 		rte_errno = EINVAL;
 		return -1;
@@ -643,36 +641,6 @@ out:
 	return ret;
 }
 
-static int
-parse_internal_args(const char *key __rte_unused, const char *value,
-		void *data)
-{
-	struct ring_internal_args **internal_args = data;
-	void *args;
-	int ret, n;
-
-	/* make sure 'value' is valid pointer length */
-	if (strnlen(value, ETH_RING_INTERNAL_ARG_MAX_LEN) >=
-			ETH_RING_INTERNAL_ARG_MAX_LEN) {
-		PMD_LOG(ERR, "Error parsing internal args, argument is too long");
-		return -1;
-	}
-
-	ret = sscanf(value, "%p%n", &args, &n);
-	if (ret == 0 || (size_t)n != strlen(value)) {
-		PMD_LOG(ERR, "Error parsing internal args");
-
-		return -1;
-	}
-
-	*internal_args = args;
-
-	if ((*internal_args)->addr != args)
-		return -1;
-
-	return 0;
-}
-
 static int
 rte_pmd_ring_probe(struct rte_vdev_device *dev)
 {
@@ -705,6 +673,21 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
 		return 0;
 	}
 
+	/* set only by rte_eth_from_rings() */
+	internal_args = RTE_PER_LCORE(eth_ring_internal_args);
+	if (internal_args != NULL) {
+		RTE_PER_LCORE(eth_ring_internal_args) = NULL;
+		ret = do_eth_dev_ring_create(name, dev,
+			internal_args->rx_queues,
+			internal_args->nb_rx_queues,
+			internal_args->tx_queues,
+			internal_args->nb_tx_queues,
+			internal_args->numa_node,
+			DEV_ATTACH,
+			&eth_dev);
+		return ret >= 0 ? 0 : ret;
+	}
+
 	if (params == NULL || params[0] == '\0') {
 		ret = eth_dev_ring_create(name, dev, rte_socket_id(), DEV_CREATE,
 				&eth_dev);
@@ -733,57 +716,37 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
 			return ret;
 		}
 
-		if (rte_kvargs_count(kvlist, ETH_RING_INTERNAL_ARG) == 1) {
-			ret = rte_kvargs_process(kvlist, ETH_RING_INTERNAL_ARG,
-						 parse_internal_args,
-						 &internal_args);
-			if (ret < 0)
-				goto out_free;
+		ret = rte_kvargs_count(kvlist, ETH_RING_NUMA_NODE_ACTION_ARG);
+		info = rte_zmalloc("struct node_action_list",
+				   sizeof(struct node_action_list) +
+				   (sizeof(struct node_action_pair) * ret),
+				   0);
+		if (!info)
+			goto out_free;
 
-			ret = do_eth_dev_ring_create(name, dev,
-				internal_args->rx_queues,
-				internal_args->nb_rx_queues,
-				internal_args->tx_queues,
-				internal_args->nb_tx_queues,
-				internal_args->numa_node,
-				DEV_ATTACH,
-				&eth_dev);
-			if (ret >= 0)
-				ret = 0;
-		} else {
-			ret = rte_kvargs_count(kvlist, ETH_RING_NUMA_NODE_ACTION_ARG);
-			info = rte_zmalloc("struct node_action_list",
-					   sizeof(struct node_action_list) +
-					   (sizeof(struct node_action_pair) * ret),
-					   0);
-			if (!info)
-				goto out_free;
+		info->total = ret;
+		info->list = (struct node_action_pair *)(info + 1);
 
-			info->total = ret;
-			info->list = (struct node_action_pair *)(info + 1);
+		ret = rte_kvargs_process(kvlist, ETH_RING_NUMA_NODE_ACTION_ARG,
+					 parse_kvlist, info);
 
-			ret = rte_kvargs_process(kvlist, ETH_RING_NUMA_NODE_ACTION_ARG,
-						 parse_kvlist, info);
+		if (ret < 0)
+			goto out_free;
 
-			if (ret < 0)
-				goto out_free;
-
-			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,
-							  &eth_dev);
-				if ((ret == -1) &&
-				    (info->list[info->count].action == DEV_CREATE)) {
-					PMD_LOG(INFO,
-						"Attach to pmd_ring for %s",
-						name);
-					ret = eth_dev_ring_create(name, dev,
-							info->list[info->count].node,
-							DEV_ATTACH,
-							&eth_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,
+						  &eth_dev);
+			if (ret == -1 && info->list[info->count].action == DEV_CREATE) {
+				PMD_LOG(INFO,
+					"Attach to pmd_ring for %s",
+					name);
+				ret = eth_dev_ring_create(name, dev,
+						info->list[info->count].node,
+						DEV_ATTACH,
+						&eth_dev);
 			}
 		}
 	}
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-10-27 11:43:55.746754586 +0000
+++ 0052-net-ring-remove-internal-devarg.patch	2026-10-27 11:43:53.562060934 +0000
@@ -1 +1 @@
-From e26eb3c0c0a6e33b60b54a82ce237a4ed6abd1b1 Mon Sep 17 00:00:00 2001
+From 11bb037bd349d10cfa00dcd2c33dceb037879c97 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e26eb3c0c0a6e33b60b54a82ce237a4ed6abd1b1 ]
+
@@ -16 +17,0 @@
-Cc: stable at dpdk.org
@@ -24 +25 @@
-index 2ba9b66b41..4cbdbe3085 100644
+index 146bdc8e029..32ed569e704 100644
@@ -27 +28 @@
-@@ -11,6 +11,7 @@
+@@ -10,6 +10,7 @@
@@ -35 +36 @@
-@@ -20,12 +21,9 @@
+@@ -19,12 +20,9 @@
@@ -48 +49 @@
-@@ -35,9 +33,11 @@ struct ring_internal_args {
+@@ -34,9 +32,11 @@ struct ring_internal_args {
@@ -61 +62 @@
-@@ -472,9 +472,7 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[],
+@@ -469,9 +469,7 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[],
@@ -71 +72 @@
-@@ -493,16 +491,16 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[],
+@@ -490,16 +488,16 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[],
@@ -92 +93 @@
-@@ -647,36 +645,6 @@ out:
+@@ -643,36 +641,6 @@ out:
@@ -129 +130 @@
-@@ -709,6 +677,21 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
+@@ -705,6 +673,21 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
@@ -151 +152 @@
-@@ -737,57 +720,37 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
+@@ -733,57 +716,37 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)


More information about the stable mailing list