patch 'table: fix variable shadowing' has been queued to stable release 25.11.1

Kevin Traynor ktraynor at redhat.com
Thu Feb 26 14:08:16 CET 2026


Hi,

FYI, your patch has been queued to stable release 25.11.1

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

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/2ca88c90bb2df6a9874d92901372c38e4574d67b

Thanks.

Kevin

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

[ upstream commit 99c39584343e13aa7f52119bd4e22cc24bb52bdb ]

Building table library with -Wshadow reveals many warnings from shadowed
variables. Fix these by removing definitions, or renaming variables as
appropriate.

Fixes: 0c06fa3bfa8c ("table: support learner tables")
Fixes: d0a00966618b ("table: add exact match SWX table")
Fixes: 1e29a162482c ("table: separate out x86-specific from LRU header")
Fixes: 8aa327214ceb ("table: hash")

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Stephen Hemminger <stephen at networkplumber.org>
---
 lib/table/rte_lru.h               | 38 +++++++++++++++----------------
 lib/table/rte_lru_arm64.h         | 14 ++++++------
 lib/table/rte_lru_x86.h           |  4 ++--
 lib/table/rte_swx_table_em.c      |  2 --
 lib/table/rte_swx_table_learner.c |  4 ++--
 lib/table/rte_table_hash_key16.c  |  4 +---
 lib/table/rte_table_hash_key32.c  |  4 +---
 lib/table/rte_table_hash_key8.c   |  4 +---
 8 files changed, 33 insertions(+), 41 deletions(-)

diff --git a/lib/table/rte_lru.h b/lib/table/rte_lru.h
index 28aab12923..1436425e16 100644
--- a/lib/table/rte_lru.h
+++ b/lib/table/rte_lru.h
@@ -42,31 +42,31 @@ while (0)
 #define lru_update(bucket, mru_val)					\
 do {									\
-	uint64_t x, pos, x0, x1, x2, mask;				\
+	uint64_t _x, _pos, _x0, _x1, _x2, _mask;			\
 									\
-	x = bucket->lru_list;						\
+	_x = bucket->lru_list;						\
 									\
-	pos = 4;							\
-	if ((x >> 48) == ((uint64_t) mru_val))				\
-		pos = 3;						\
+	_pos = 4;							\
+	if ((_x >> 48) == ((uint64_t) mru_val))			\
+		_pos = 3;						\
 									\
-	if (((x >> 32) & 0xFFFFLLU) == ((uint64_t) mru_val))		\
-		pos = 2;						\
+	if (((_x >> 32) & 0xFFFFLLU) == ((uint64_t) mru_val))		\
+		_pos = 2;						\
 									\
-	if (((x >> 16) & 0xFFFFLLU) == ((uint64_t) mru_val))		\
-		pos = 1;						\
+	if (((_x >> 16) & 0xFFFFLLU) == ((uint64_t) mru_val))		\
+		_pos = 1;						\
 									\
-	if ((x & 0xFFFFLLU) == ((uint64_t) mru_val))			\
-		pos = 0;						\
+	if ((_x & 0xFFFFLLU) == ((uint64_t) mru_val))			\
+		_pos = 0;						\
 									\
 									\
-	pos <<= 4;							\
-	mask = (~0LLU) << pos;						\
-	x0 = x & (~mask);						\
-	x1 = (x >> 16) & mask;						\
-	x2 = (x << (48 - pos)) & (0xFFFFLLU << 48);			\
-	x = x0 | x1 | x2;						\
+	_pos <<= 4;							\
+	_mask = (~0LLU) << _pos;					\
+	_x0 = _x & (~_mask);						\
+	_x1 = (_x >> 16) & _mask;					\
+	_x2 = (_x << (48 - _pos)) & (0xFFFFLLU << 48);			\
+	_x = _x0 | _x1 | _x2;						\
 									\
-	if (pos != 64)							\
-		bucket->lru_list = x;					\
+	if (_pos != 64)							\
+		bucket->lru_list = _x;					\
 } while (0)
 
diff --git a/lib/table/rte_lru_arm64.h b/lib/table/rte_lru_arm64.h
index f9a4678ee0..817b791b6e 100644
--- a/lib/table/rte_lru_arm64.h
+++ b/lib/table/rte_lru_arm64.h
@@ -41,14 +41,14 @@ f_lru_pos(uint64_t lru_list)
 #define lru_update(bucket, mru_val)					\
 do {									\
-	const uint64_t orvals[] = {0xFFFFLLU, 0xFFFFLLU << 16,		\
+	const uint64_t _orvals[] = {0xFFFFLLU, 0xFFFFLLU << 16,		\
 		0xFFFFLLU << 32, 0xFFFFLLU << 48, 0LLU};		\
-	const uint64_t decs[] = {0x1000100010001LLU, 0};		\
-	uint64x1_t lru = vdup_n_u64(bucket->lru_list);			\
-	uint64x1_t vdec = vdup_n_u64(decs[mru_val>>2]);			\
+	const uint64_t _decs[] = {0x1000100010001LLU, 0};		\
+	uint64x1_t _lru = vdup_n_u64(bucket->lru_list);			\
+	uint64x1_t _vdec = vdup_n_u64(_decs[mru_val>>2]);			\
 	bucket->lru_list = vget_lane_u64(vreinterpret_u64_u16(		\
-				vsub_u16(vreinterpret_u16_u64(lru),	\
-					vreinterpret_u16_u64(vdec))),	\
+				vsub_u16(vreinterpret_u16_u64(_lru),	\
+					vreinterpret_u16_u64(_vdec))),	\
 				0);					\
-	bucket->lru_list |= orvals[mru_val];				\
+	bucket->lru_list |= _orvals[mru_val];				\
 } while (0)
 
diff --git a/lib/table/rte_lru_x86.h b/lib/table/rte_lru_x86.h
index 93f4a136a8..de74513653 100644
--- a/lib/table/rte_lru_x86.h
+++ b/lib/table/rte_lru_x86.h
@@ -51,7 +51,7 @@ do {									\
 	__m128i d = _mm_minpos_epu16(c);				\
 	/* Second word is the index to found word (first word is the value) */\
-	unsigned int pos = _mm_extract_epi16(d, 1);			\
+	unsigned int _pos = _mm_extract_epi16(d, 1);			\
 	/* move the recently used location to top of list */		\
-	__m128i k = _mm_shuffle_epi8(b, *((__m128i *) &masks[2 * pos]));\
+	__m128i k = _mm_shuffle_epi8(b, *((__m128i *) &masks[2 * _pos]));\
 	/* Finally, update the original list with the reordered data */	\
 	bucket->lru_list = _mm_extract_epi64(k, 0);			\
diff --git a/lib/table/rte_swx_table_em.c b/lib/table/rte_swx_table_em.c
index 4ec54cb635..c408ea6fc3 100644
--- a/lib/table/rte_swx_table_em.c
+++ b/lib/table/rte_swx_table_em.c
@@ -622,6 +622,4 @@ table_create(struct rte_swx_table_params *params,
 
 	TAILQ_FOREACH(entry, entries, node) {
-		int status;
-
 		status = table_add(t, entry);
 		if (status) {
diff --git a/lib/table/rte_swx_table_learner.c b/lib/table/rte_swx_table_learner.c
index 2d61bceeaf..3680bf26c1 100644
--- a/lib/table/rte_swx_table_learner.c
+++ b/lib/table/rte_swx_table_learner.c
@@ -412,5 +412,5 @@ rte_swx_table_learner_lookup(void *table,
 			uint64_t time = b->time[i];
 			uint32_t sig = b->sig[i];
-			uint8_t *key = table_bucket_key_get(t, b, i);
+			uint8_t *k = table_bucket_key_get(t, b, i);
 
 			time <<= 32;
@@ -418,5 +418,5 @@ rte_swx_table_learner_lookup(void *table,
 			if ((time > input_time) &&
 			    (sig == m->input_sig) &&
-			    t->params.keycmp_func(key, m->input_key, t->params.key_size)) {
+			    t->params.keycmp_func(k, m->input_key, t->params.key_size)) {
 				uint64_t *data = table_bucket_data_get(t, b, i);
 
diff --git a/lib/table/rte_table_hash_key16.c b/lib/table/rte_table_hash_key16.c
index da24a7985d..5b69106dd7 100644
--- a/lib/table/rte_table_hash_key16.c
+++ b/lib/table/rte_table_hash_key16.c
@@ -1134,10 +1134,8 @@ grind_next_buckets:
 
 		for ( ; buckets_mask; ) {
-			uint64_t pkt_mask;
 			uint32_t pkt_index;
 
 			pkt_index = rte_ctz64(buckets_mask);
-			pkt_mask = 1LLU << pkt_index;
-			buckets_mask &= ~pkt_mask;
+			buckets_mask &= ~(1LLU << pkt_index);
 
 			lookup_grinder(pkt_index, buckets, keys, pkts_mask_out,
diff --git a/lib/table/rte_table_hash_key32.c b/lib/table/rte_table_hash_key32.c
index 297931a2a5..0963f57828 100644
--- a/lib/table/rte_table_hash_key32.c
+++ b/lib/table/rte_table_hash_key32.c
@@ -1168,10 +1168,8 @@ grind_next_buckets:
 
 		for ( ; buckets_mask; ) {
-			uint64_t pkt_mask;
 			uint32_t pkt_index;
 
 			pkt_index = rte_ctz64(buckets_mask);
-			pkt_mask = 1LLU << pkt_index;
-			buckets_mask &= ~pkt_mask;
+			buckets_mask &= ~(1LLU << pkt_index);
 
 			lookup_grinder(pkt_index, buckets, keys, pkts_mask_out,
diff --git a/lib/table/rte_table_hash_key8.c b/lib/table/rte_table_hash_key8.c
index 746863082f..5e9dcf10ee 100644
--- a/lib/table/rte_table_hash_key8.c
+++ b/lib/table/rte_table_hash_key8.c
@@ -1102,10 +1102,8 @@ grind_next_buckets:
 
 		for ( ; buckets_mask; ) {
-			uint64_t pkt_mask;
 			uint32_t pkt_index;
 
 			pkt_index = rte_ctz64(buckets_mask);
-			pkt_mask = 1LLU << pkt_index;
-			buckets_mask &= ~pkt_mask;
+			buckets_mask &= ~(1LLU << pkt_index);
 
 			lookup_grinder(pkt_index, buckets, keys, pkts_mask_out,
-- 
2.53.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-02-26 10:16:47.721256972 +0000
+++ 0014-table-fix-variable-shadowing.patch	2026-02-26 10:16:46.901459019 +0000
@@ -1 +1 @@
-From 99c39584343e13aa7f52119bd4e22cc24bb52bdb Mon Sep 17 00:00:00 2001
+From 2ca88c90bb2df6a9874d92901372c38e4574d67b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 99c39584343e13aa7f52119bd4e22cc24bb52bdb ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org



More information about the stable mailing list