[dpdk-dev] [PATCH] lib/librte_hash: avoid iterate bugs with delete keys.

Wang, Yipeng1 yipeng1.wang at intel.com
Wed May 13 01:50:16 CEST 2020


> -----Original Message-----
> From: dev <dev-bounces at dpdk.org> On Behalf Of Lilijun (Jerry)
> Sent: Sunday, April 26, 2020 8:41 PM
> To: 'dev at dpdk.org' <dev at dpdk.org>
> Cc: wangyunjian <wangyunjian at huawei.com>; xudingke
> <xudingke at huawei.com>; 'stable at dpdk.org' <stable at dpdk.org>
> Subject: [dpdk-dev] [PATCH] lib/librte_hash: avoid iterate bugs with delete
> keys.
> 
> From 0faea722b82ffe30adfa55d5ea4ad3a23ed30d4e Mon Sep 17 00:00:00
> 2001
> From: Yunjian Wang <wangyunjian at huawei.com>
> Date: Mon, 27 Apr 2020 11:12:25 +0800
> Subject: [PATCH] lib/librte_hash: avoid iterate bugs with delete keys.
> 
> The keys idx are stored in rte_hash main and extend bucket key slots.
> 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.
> So we add a new API rte_hash_del_key_fixed() used in iterate loop to avoid
> this bugs.
> 
> Signed-off-by: Lilijun <jerry.lilijun at huawei.com>
> Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
> ---
> --
> 2.19.1
[Wang, Yipeng] 
Is this the same patch to the previous one? Please see my reply on the previous thread.
You could add " --in-reply-to" to supersede the previous version, which will make the maintaining work easier.


More information about the dev mailing list