Re: [dpdk-dev] [PATCH v4 1/2] hash table: fix a bug in rte_hash_iterate()

2018-10-09 Thread Wang, Yipeng1
Hi Qiaobin, This patch: http://patchwork.dpdk.org/patch/46105/ covers the bug. Honnappa suggested a fix that would work well for the lock free implementation as well. >-Original Message- >From: Qiaobin Fu [mailto:qiaob...@bu.edu] >Sent: Tuesday, October 9, 2018 12:29 PM >To: Richardson,

[dpdk-dev] [PATCH v4 1/2] hash table: fix a bug in rte_hash_iterate()

2018-10-09 Thread Qiaobin Fu
In current implementation of rte_hash_iterate(), it tries to obtain the lock after the while loop. However, this may lead to a bug. Notice the following racing condition: 1. The while loop above finishes because it finds a not empty slot. But it does so without a lock. 2. Then we get the lock.