public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
* [PATCH dpdk 0/2] hash: safe data replacement on overwrite
@ 2026-02-12 21:33 Robin Jarry
  2026-02-12 21:33 ` [PATCH dpdk 1/2] hash: free replaced data on overwrite when RCU is configured Robin Jarry
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Robin Jarry @ 2026-02-12 21:33 UTC (permalink / raw)
  To: dev

When rte_hash_add_key_data() is called with an existing key, the old
data pointer is silently overwritten. With RCU-protected readers still
potentially accessing the old data, the application cannot safely free
it since the old pointer is never returned.

This series provides two ways to address the problem:

* Automatic: when RCU is configured with a free_key_data_func callback,
  rte_hash_add_key_data() now automatically defers freeing the old data
  on overwrite. No caller changes are needed.

* Explicit: a new rte_hash_replace_key_data() API returns the previous
  data pointer via an output parameter, giving the caller full control
  over the old pointer's lifecycle. No automatic deferred free is
  performed in that case.

Robin Jarry (2):
  hash: free replaced data on overwrite when RCU is configured
  hash: add replace API returning old data on overwrite

 app/test/test_hash.c                   | 214 +++++++++++++++++++++++++
 doc/guides/rel_notes/release_26_03.rst |  12 ++
 lib/hash/rte_cuckoo_hash.c             | 146 +++++++++++++----
 lib/hash/rte_hash.h                    |  75 ++++++++-
 4 files changed, 417 insertions(+), 30 deletions(-)

-- 
2.53.0


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2026-03-17  9:40 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-12 21:33 [PATCH dpdk 0/2] hash: safe data replacement on overwrite Robin Jarry
2026-02-12 21:33 ` [PATCH dpdk 1/2] hash: free replaced data on overwrite when RCU is configured Robin Jarry
2026-02-12 21:33 ` [PATCH dpdk 2/2] hash: add replace API returning old data on overwrite Robin Jarry
2026-02-12 22:55 ` [PATCH dpdk 0/2] hash: safe data replacement " Stephen Hemminger
2026-02-13 10:34 ` [PATCH dpdk v2 0/3] " Robin Jarry
2026-02-13 10:34   ` [PATCH dpdk v2 1/3] hash: avoid leaking entries on RCU defer queue failure Robin Jarry
2026-03-04 10:28     ` Konstantin Ananyev
2026-02-13 10:34   ` [PATCH dpdk v2 2/3] hash: free replaced data on overwrite when RCU is configured Robin Jarry
2026-03-04 11:40     ` Konstantin Ananyev
2026-03-04 11:45       ` Robin Jarry
2026-03-04 12:50         ` Robin Jarry
2026-02-13 10:34   ` [PATCH dpdk v2 3/3] hash: add replace API returning old data on overwrite Robin Jarry
2026-03-04 11:44     ` Konstantin Ananyev
2026-03-06  8:47 ` [PATCH dpdk v3 0/2] hash: safe data replacement " Robin Jarry
2026-03-06  8:47   ` [PATCH dpdk v3 1/2] hash: avoid leaking entries on RCU defer queue failure Robin Jarry
2026-03-06  8:47   ` [PATCH dpdk v3 2/2] hash: free replaced data on overwrite when RCU is configured Robin Jarry
2026-03-09  7:48     ` Konstantin Ananyev
2026-03-09  7:50   ` [PATCH dpdk v3 0/2] hash: safe data replacement on overwrite Konstantin Ananyev
2026-03-09  7:52     ` Robin Jarry
2026-03-09  8:32       ` Konstantin Ananyev
2026-03-17  9:40   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox