summaryrefslogtreecommitdiffstats
path: root/lib/librte_hash/rte_cuckoo_hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/librte_hash/rte_cuckoo_hash.c')
-rw-r--r--lib/librte_hash/rte_cuckoo_hash.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c
index 049ff988..2414c7f2 100644
--- a/lib/librte_hash/rte_cuckoo_hash.c
+++ b/lib/librte_hash/rte_cuckoo_hash.c
@@ -212,7 +212,9 @@ rte_hash_create(const struct rte_hash_parameters *params)
goto err_unlock;
}
- const uint32_t key_entry_size = sizeof(struct rte_hash_key) + params->key_len;
+ const uint32_t key_entry_size =
+ RTE_ALIGN(sizeof(struct rte_hash_key) + params->key_len,
+ KEY_ALIGNMENT);
const uint64_t key_tbl_size = (uint64_t) key_entry_size * num_key_slots;
k = rte_zmalloc_socket(NULL, key_tbl_size,
@@ -405,7 +407,7 @@ rte_hash_reset(struct rte_hash *h)
/* clear the free ring */
while (rte_ring_dequeue(h->free_slots, &ptr) == 0)
- rte_pause();
+ continue;
/* Repopulate the free slots ring. Entry zero is reserved for key misses */
if (h->hw_trans_mem_support)