DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] rte_hash bug: can't iterate all entries when deleting keys in rte_hash iterate loop.
@ 2020-04-18 10:00 Lilijun (Jerry)
  0 siblings, 0 replies; only message in thread
From: Lilijun (Jerry) @ 2020-04-18 10:00 UTC (permalink / raw)
  To: 'dev@dpdk.org', 'stable@dpdk.org'

Hi all,

    In my test, entries can't be cleanup in rte_hash table when deleting keys in rte_hash iterate loop. The test steps:
    1.  create a hash table table1 with limit 30000, ext bucket enabled,  and insert 30000 entries into this hash table.
    2.  create a larger hash table table2 with limit 60000, , ext bucket enabled.
    3.  iterate all entries of table1 and insert them to the table2. Insert new 10000 entries to this table2.
    4.  Then flush all entries from table2 by deleting keys in rte_hash iterate loop. But there are still some keys leaked in table2.

    From my analysis, the keys idx are stored in rte_hash main bucket key slots and extend bucket key stots. 
    We iterate every no empty Keys in h->buckets and h->buckets_ext from start to last. 
    When deleting keys the function __rte_hash_compact_ll() may move last_bkt's key to previous bucket in order to compact extend bucket list.
    If the previous bucket has been iterated, the moved key may be missed for users. 
    Then those missed keys are leaked and rte_hash table can't be cleanup.

    Now I retry the iterate and delete keys, that can avoid this bug. 

    Is there any ideas or solutions on this bug?   Thanks.

Jerry.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-18 10:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-18 10:00 [dpdk-dev] rte_hash bug: can't iterate all entries when deleting keys in rte_hash iterate loop Lilijun (Jerry)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).