numam-dpdk/lib/librte_hash
Pablo de Lara 24c20a7221 hash: fix false zero signature key hit lookup
This commit fixes a corner case scenario. When a key is deleted,
its signature in the hash table gets clear, which should prevent
a lookup of that same key, unless the signature of the key is all zeroes.

In that case, there will be a match, and key would be compared against
the key that is in the table (which does not get cleared,
as the performance penalty would be high), resulting in a wrong hit.

To prevent this from happening, the key index associated to that entry
should be set to zero when deleting it, so in case that same key
is looked up just after a deletion, it will point to the dummy key slot,
which guarantees a miss.

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

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Saikrishna Edupuganti <saikrishna.edupuganti@intel.com>
2016-09-29 21:50:32 +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_x86.h hash: add scalable multi-writer insertion with Intel TSX 2016-06-24 16:25:07 +02:00
rte_cuckoo_hash.c hash: fix false zero signature key hit lookup 2016-09-29 21:50:32 +02:00
rte_cuckoo_hash.h hash: add scalable multi-writer insertion with Intel TSX 2016-06-24 16:25:07 +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 lib: use C99 syntax for zero-size arrays 2016-09-13 15:35:28 +02:00
rte_hash_crc.h hash: fix CRC32c computation 2016-03-01 14:37:26 +01:00
rte_hash_version.map hash: retrieve a key given its position 2016-07-10 14:56:45 +02:00
rte_hash.h hash: retrieve a key given its position 2016-07-10 14:56:45 +02:00
rte_jhash.h hash: fix header for C++ 2016-02-21 11:47:57 +01:00
rte_thash.h lib: work around unnamed structs/unions 2016-09-13 15:35:28 +02:00