patch 'pipeline: fix variable shadowing' has been queued to stable release 23.11.7

Shani Peretz shperetz at nvidia.com
Tue Mar 31 08:23:38 CEST 2026


Hi,

FYI, your patch has been queued to stable release 23.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/05/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/shanipr/dpdk-stable

This queued commit can be viewed at:
https://github.com/shanipr/dpdk-stable/commit/1708953d869d928359b3ace64e761405ca1dd729

Thanks.

Shani

---
>From 1708953d869d928359b3ace64e761405ca1dd729 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson at intel.com>
Date: Wed, 14 Jan 2026 15:44:20 +0000
Subject: [PATCH] pipeline: fix variable shadowing

[ upstream commit 5b83f52407d681f176262b5db9f3ca09226d2a37 ]

Remove unnecessary inner variables and rename others in order to remove
variable shadowing warnings from the code.

Fixes: ea5ab65f5743 ("pipeline: relax table match field requirements")
Fixes: cdaa937d3eaa ("pipeline: support selector table")
Fixes: 5f3e6104227c ("pipeline: prepare for variable size headers")
Fixes: 724f3ef422e9 ("pipeline: generate custom instruction functions")
Fixes: 68b95704a6a3 ("pipeline: add API for shared library-based pipeline build")

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Stephen Hemminger <stephen at networkplumber.org>
---
 lib/pipeline/rte_swx_ctl.c               | 11 +++++------
 lib/pipeline/rte_swx_pipeline.c          | 21 ++++++++++-----------
 lib/pipeline/rte_swx_pipeline_internal.h | 10 +++++-----
 3 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/lib/pipeline/rte_swx_ctl.c b/lib/pipeline/rte_swx_ctl.c
index 857770d297..f2cfd02f4d 100644
--- a/lib/pipeline/rte_swx_ctl.c
+++ b/lib/pipeline/rte_swx_ctl.c
@@ -209,7 +209,7 @@ table_params_get(struct rte_swx_ctl_pipeline *ctl, uint32_t table_id)
 	uint32_t key_size = 0, key_offset = 0, action_data_size = 0, i;
 
 	if (table->info.n_match_fields) {
-		uint32_t n_match_fields_em = 0, i;
+		uint32_t n_match_fields_em = 0;
 
 		/* Find first (smallest offset) and last (biggest offset) match fields. */
 		first = &table->mf[0];
@@ -854,22 +854,21 @@ selector_free(struct rte_swx_ctl_pipeline *ctl)
 
 	for (i = 0; i < ctl->info.n_selectors; i++) {
 		struct selector *s = &ctl->selectors[i];
-		uint32_t i;
 
 		/* selector_fields. */
 		free(s->selector_fields);
 
 		/* groups. */
 		if (s->groups)
-			for (i = 0; i < s->info.n_groups_max; i++)
-				selector_group_members_free(s, i);
+			for (uint32_t j = 0; j < s->info.n_groups_max; j++)
+				selector_group_members_free(s, j);
 
 		free(s->groups);
 
 		/* pending_groups. */
 		if (s->pending_groups)
-			for (i = 0; i < s->info.n_groups_max; i++)
-				selector_pending_group_members_free(s, i);
+			for (uint32_t j = 0; j < s->info.n_groups_max; j++)
+				selector_pending_group_members_free(s, j);
 
 		free(s->pending_groups);
 
diff --git a/lib/pipeline/rte_swx_pipeline.c b/lib/pipeline/rte_swx_pipeline.c
index da37eda231..dab57434b1 100644
--- a/lib/pipeline/rte_swx_pipeline.c
+++ b/lib/pipeline/rte_swx_pipeline.c
@@ -1502,10 +1502,10 @@ static int
 header_build(struct rte_swx_pipeline *p)
 {
 	struct header *h;
-	uint32_t n_bytes = 0, i;
+	uint32_t total_bytes = 0, i;
 
 	TAILQ_FOREACH(h, &p->headers, node) {
-		n_bytes += h->st->n_bits / 8;
+		total_bytes += h->st->n_bits / 8;
 	}
 
 	for (i = 0; i < RTE_SWX_PIPELINE_THREADS_MAX; i++) {
@@ -1520,10 +1520,10 @@ header_build(struct rte_swx_pipeline *p)
 					sizeof(struct header_out_runtime));
 		CHECK(t->headers_out, ENOMEM);
 
-		t->header_storage = calloc(1, n_bytes);
+		t->header_storage = calloc(1, total_bytes);
 		CHECK(t->header_storage, ENOMEM);
 
-		t->header_out_storage = calloc(1, n_bytes);
+		t->header_out_storage = calloc(1, total_bytes);
 		CHECK(t->header_out_storage, ENOMEM);
 
 		TAILQ_FOREACH(h, &p->headers, node) {
@@ -13805,7 +13805,6 @@ instruction_group_list_create(struct rte_swx_pipeline *p)
 
 		for (i = 0; i < p->n_instructions; i++) {
 			struct instruction_data *data = &p->instruction_data[i];
-			struct instruction_group *g;
 			uint32_t j;
 
 			/* Continue when the current instruction is not a jump destination. */
@@ -14518,11 +14517,11 @@ rte_swx_pipeline_build_from_lib(struct rte_swx_pipeline **pipeline,
 
 	/* Action instructions. */
 	TAILQ_FOREACH(a, &p->actions, node) {
-		char name[RTE_SWX_NAME_SIZE * 2];
+		char action_name[RTE_SWX_NAME_SIZE * 2];
 
-		snprintf(name, sizeof(name), "action_%s_run", a->name);
+		snprintf(action_name, sizeof(action_name), "action_%s_run", a->name);
 
-		p->action_funcs[a->id] = dlsym(lib, name);
+		p->action_funcs[a->id] = dlsym(lib, action_name);
 		if (!p->action_funcs[a->id]) {
 			status = -EINVAL;
 			goto free;
@@ -14537,14 +14536,14 @@ rte_swx_pipeline_build_from_lib(struct rte_swx_pipeline **pipeline,
 	}
 
 	TAILQ_FOREACH(g, igl, node) {
-		char name[RTE_SWX_NAME_SIZE * 2];
+		char pipeline_name[RTE_SWX_NAME_SIZE * 2];
 
 		if (g->first_instr_id == g->last_instr_id)
 			continue;
 
-		snprintf(name, sizeof(name), "pipeline_func_%u", g->group_id);
+		snprintf(pipeline_name, sizeof(pipeline_name), "pipeline_func_%u", g->group_id);
 
-		g->func = dlsym(lib, name);
+		g->func = dlsym(lib, pipeline_name);
 		if (!g->func) {
 			status = -EINVAL;
 			goto free;
diff --git a/lib/pipeline/rte_swx_pipeline_internal.h b/lib/pipeline/rte_swx_pipeline_internal.h
index a67b6e965d..2a419c3634 100644
--- a/lib/pipeline/rte_swx_pipeline_internal.h
+++ b/lib/pipeline/rte_swx_pipeline_internal.h
@@ -1738,14 +1738,14 @@ emit_handler(struct thread *t)
 	if ((t->n_headers_out == 2) &&
 	    (h1->ptr + h1->n_bytes == t->ptr) &&
 	    (h0->ptr == h0->ptr0)) {
-		uint32_t offset;
+		uint32_t ofs;
 
 		TRACE("Emit handler: header encapsulation.\n");
 
-		offset = h0->n_bytes + h1->n_bytes;
-		memcpy(t->ptr - offset, h0->ptr, h0->n_bytes);
-		t->pkt.offset -= offset;
-		t->pkt.length += offset;
+		ofs = h0->n_bytes + h1->n_bytes;
+		memcpy(t->ptr - ofs, h0->ptr, h0->n_bytes);
+		t->pkt.offset -= ofs;
+		t->pkt.length += ofs;
 
 		return;
 	}
-- 
2.43.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-03-31 00:32:31.228635887 +0300
+++ 0019-pipeline-fix-variable-shadowing.patch	2026-03-31 00:32:28.620423000 +0300
@@ -1 +1 @@
-From 5b83f52407d681f176262b5db9f3ca09226d2a37 Mon Sep 17 00:00:00 2001
+From 1708953d869d928359b3ace64e761405ca1dd729 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5b83f52407d681f176262b5db9f3ca09226d2a37 ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org
@@ -25 +26 @@
-index 4e9bb842a1..d24764cbbe 100644
+index 857770d297..f2cfd02f4d 100644
@@ -28 +29 @@
-@@ -210,7 +210,7 @@ table_params_get(struct rte_swx_ctl_pipeline *ctl, uint32_t table_id)
+@@ -209,7 +209,7 @@ table_params_get(struct rte_swx_ctl_pipeline *ctl, uint32_t table_id)
@@ -37 +38 @@
-@@ -855,22 +855,21 @@ selector_free(struct rte_swx_ctl_pipeline *ctl)
+@@ -854,22 +854,21 @@ selector_free(struct rte_swx_ctl_pipeline *ctl)
@@ -65 +66 @@
-index 2193bc4ebf..a9157815e4 100644
+index da37eda231..dab57434b1 100644
@@ -68 +69 @@
-@@ -1515,10 +1515,10 @@ static int
+@@ -1502,10 +1502,10 @@ static int
@@ -81 +82 @@
-@@ -1533,10 +1533,10 @@ header_build(struct rte_swx_pipeline *p)
+@@ -1520,10 +1520,10 @@ header_build(struct rte_swx_pipeline *p)
@@ -94 +95 @@
-@@ -14031,7 +14031,6 @@ instruction_group_list_create(struct rte_swx_pipeline *p)
+@@ -13805,7 +13805,6 @@ instruction_group_list_create(struct rte_swx_pipeline *p)
@@ -102 +103 @@
-@@ -14746,11 +14745,11 @@ rte_swx_pipeline_build_from_lib(struct rte_swx_pipeline **pipeline,
+@@ -14518,11 +14517,11 @@ rte_swx_pipeline_build_from_lib(struct rte_swx_pipeline **pipeline,
@@ -117 +118 @@
-@@ -14765,14 +14764,14 @@ rte_swx_pipeline_build_from_lib(struct rte_swx_pipeline **pipeline,
+@@ -14537,14 +14536,14 @@ rte_swx_pipeline_build_from_lib(struct rte_swx_pipeline **pipeline,
@@ -136 +137 @@
-index df864ea066..f527857861 100644
+index a67b6e965d..2a419c3634 100644
@@ -139 +140 @@
-@@ -1772,14 +1772,14 @@ emit_handler(struct thread *t)
+@@ -1738,14 +1738,14 @@ emit_handler(struct thread *t)


More information about the stable mailing list