numam-dpdk/lib/librte_hash
Olivier Matz 5d7bfb7337 hash: fix race condition at creation
To avoid a race condition while creating a new hash object, the
list has to be locked before the lookup, and released only once the
new object is added in the list.

As the lock is held by the rte_ring_create(), move its creation at the
beginning of the function and only take the lock after the ring is
created to avoid a deadlock.

Fixes: 48a3991196 ("hash: replace with cuckoo hash implementation")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-04-06 17:30:51 +02:00
..
Makefile hash: use armv8-a CRC32 instructions 2015-11-25 22:13:15 +01:00
rte_cmp_arm64.h hash: replace libc memcmp with optimized functions for arm64 2015-11-25 22:11:37 +01:00
rte_cmp_x86.h remove extra parentheses in return statement 2016-02-10 15:47:50 +01:00
rte_crc_arm64.h hash: fix CRC32c computation 2016-03-01 14:37:26 +01:00
rte_cuckoo_hash.c hash: fix race condition at creation 2016-04-06 17:30:51 +02:00
rte_fbk_hash.c hash: fix allocation of an existing object 2016-04-06 17:30:48 +02:00
rte_fbk_hash.h hash: select CRC hash if armv8-a CRC extension available 2015-11-25 22:14:00 +01:00
rte_hash_crc.h hash: fix CRC32c computation 2016-03-01 14:37:26 +01:00
rte_hash_version.map hash: customize compare function 2015-12-07 00:55:50 +01:00
rte_hash.h hash: fix typo in comment 2016-04-01 15:07:53 +02:00
rte_jhash.h hash: fix header for C++ 2016-02-21 11:47:57 +01:00
rte_thash.h hash: fix build of toeplitz algorithm without SSE3 2015-07-30 02:15:32 +02:00