Re: [dpdk-dev] [PATCH v5 1/4] hash: fix race condition in iterate

2018-10-02 Thread Honnappa Nagarahalli
> -Original Message- > From: Yipeng Wang > Sent: Monday, October 1, 2018 1:35 PM > To: bruce.richard...@intel.com > Cc: konstantin.anan...@intel.com; dev@dpdk.org; > yipeng1.w...@intel.com; Honnappa Nagarahalli > ; sameh.gobr...@intel.com > Subject: [PATCH v5 1/4] hash: fix race conditi

[dpdk-dev] [PATCH v5 1/4] hash: fix race condition in iterate

2018-10-01 Thread Yipeng Wang
In rte_hash_iterate, the reader lock did not protect the while loop which checks empty entry. This created a race condition that the entry may become empty when enters the lock, then a wrong key data value would be read out. This commit reads out the position in the while condition, which makes su