hash: fix free slot check
In function rte_hash_cuckoo_insert_mw_tm, while looking for
an empty slot, only the first entry in the bucket was being checked,
as key_idx array was not being iterated.
Fixes: 5fc74c2e14
("hash: check if slot is empty with key index")
Reported-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
This commit is contained in:
parent
faaf69adb9
commit
5230bc4c77
@ -53,7 +53,7 @@ rte_hash_cuckoo_insert_mw_tm(struct rte_hash_bucket *prim_bkt,
|
|||||||
*/
|
*/
|
||||||
for (i = 0; i < RTE_HASH_BUCKET_ENTRIES; i++) {
|
for (i = 0; i < RTE_HASH_BUCKET_ENTRIES; i++) {
|
||||||
/* Check if slot is available */
|
/* Check if slot is available */
|
||||||
if (likely(prim_bkt->key_idx == EMPTY_SLOT)) {
|
if (likely(prim_bkt->key_idx[i] == EMPTY_SLOT)) {
|
||||||
prim_bkt->signatures[i].current = sig;
|
prim_bkt->signatures[i].current = sig;
|
||||||
prim_bkt->signatures[i].alt = alt_hash;
|
prim_bkt->signatures[i].alt = alt_hash;
|
||||||
prim_bkt->key_idx[i] = new_idx;
|
prim_bkt->key_idx[i] = new_idx;
|
||||||
|
Loading…
Reference in New Issue
Block a user