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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Mar 19 23:02:41 CET 2026


Hi,

FYI, your patch has been queued to stable release 24.11.5

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/21/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/1f3c5d9651870ca8bd7720d39f1367023392d757

Thanks.

Luca Boccassi

---
>From 1f3c5d9651870ca8bd7720d39f1367023392d757 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 03bf2ab356..0cfe2d1f26 100644
--- a/lib/hash/rte_cuckoo_hash.c
+++ b/lib/hash/rte_cuckoo_hash.c
@@ -1834,18 +1834,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)
-				HASH_LOG(ERR, "Failed to push QSBR FIFO");
+		}
 	}
 	__hash_rw_writer_unlock(h);
 	return ret;
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-03-19 22:00:49.556711413 +0000
+++ 0049-hash-avoid-leaking-entries-on-RCU-defer-queue-failur.patch	2026-03-19 22:00:47.814359367 +0000
@@ -1 +1 @@
-From cbc677ce0df333b92f7838af47699fa68796a86e Mon Sep 17 00:00:00 2001
+From 1f3c5d9651870ca8bd7720d39f1367023392d757 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 03bf2ab356..0cfe2d1f26 100644
@@ -23 +24 @@
-@@ -1870,18 +1870,15 @@ return_key:
+@@ -1834,18 +1834,15 @@ return_key:


More information about the stable mailing list