patch 'hash: avoid leaking entries on RCU defer queue failure' has been queued to stable release 23.11.7

Shani Peretz shperetz at nvidia.com
Wed Apr 15 11:59:44 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/19/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/2d944c44bf6776aaf9b1832b7e39ec7917a6b2c1

Thanks.

Shani

---
>From 2d944c44bf6776aaf9b1832b7e39ec7917a6b2c1 Mon Sep 17 00:00:00 2001
From: Robin Jarry <rjarry at redhat.com>
Date: Fri, 6 Mar 2026 09:47:11 +0100
Subject: [PATCH] hash: avoid leaking entries on RCU defer queue failure

[ upstream commit cbc677ce0df333b92f7838af47699fa68796a86e ]

When rte_rcu_qsbr_dq_enqueue() fails in DQ mode, the deleted key slot
is never freed and becomes permanently leaked. Fall back to synchronous
reclamation instead of only logging an error.

Fixes: 769b2de7fb52 ("hash: implement RCU resources reclamation")

Signed-off-by: Robin Jarry <rjarry at redhat.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev at huawei.com>
---
 lib/hash/rte_cuckoo_hash.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c
index c156c7aa16..9a58fb2e3c 100644
--- a/lib/hash/rte_cuckoo_hash.c
+++ b/lib/hash/rte_cuckoo_hash.c
@@ -1769,18 +1769,15 @@ return_key:
 		/* Key index where key is stored, adding the first dummy index */
 		rcu_dq_entry.key_idx = ret + 1;
 		rcu_dq_entry.ext_bkt_idx = index;
-		if (h->dq == NULL) {
+		if (h->dq == NULL || rte_rcu_qsbr_dq_enqueue(h->dq, &rcu_dq_entry) != 0) {
 			/* Wait for quiescent state change if using
-			 * RTE_HASH_QSBR_MODE_SYNC
+			 * RTE_HASH_QSBR_MODE_SYNC or if RCU enqueue failed.
 			 */
 			rte_rcu_qsbr_synchronize(h->hash_rcu_cfg->v,
 						 RTE_QSBR_THRID_INVALID);
 			__hash_rcu_qsbr_free_resource((void *)((uintptr_t)h),
 						      &rcu_dq_entry, 1);
-		} else if (h->dq)
-			/* Push into QSBR FIFO if using RTE_HASH_QSBR_MODE_DQ */
-			if (rte_rcu_qsbr_dq_enqueue(h->dq, &rcu_dq_entry) != 0)
-				RTE_LOG(ERR, HASH, "Failed to push QSBR FIFO\n");
+		}
 	}
 	__hash_rw_writer_unlock(h);
 	return ret;
-- 
2.43.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-04-14 14:44:32.989889202 +0300
+++ 0043-hash-avoid-leaking-entries-on-RCU-defer-queue-failur.patch	2026-04-14 14:44:28.619542000 +0300
@@ -1 +1 @@
-From cbc677ce0df333b92f7838af47699fa68796a86e Mon Sep 17 00:00:00 2001
+From 2d944c44bf6776aaf9b1832b7e39ec7917a6b2c1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit cbc677ce0df333b92f7838af47699fa68796a86e ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index 3f382dd117..36b3b477a5 100644
+index c156c7aa16..9a58fb2e3c 100644
@@ -23 +24 @@
-@@ -1870,18 +1870,15 @@ return_key:
+@@ -1769,18 +1769,15 @@ return_key:
@@ -40 +41 @@
--				HASH_LOG(ERR, "Failed to push QSBR FIFO");
+-				RTE_LOG(ERR, HASH, "Failed to push QSBR FIFO\n");


More information about the stable mailing list