summaryrefslogtreecommitdiffstats
path: root/lib/librte_hash
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2019-03-20 14:45:09 +0000
committerLuca Boccassi <luca.boccassi@gmail.com>2019-03-20 14:45:37 +0000
commitf7a9461e29147c47ce2bb81bd157ac1833cf5eb1 (patch)
tree6f3b4f4850cf9f116acc1dda3f0515259673e13b /lib/librte_hash
parent8e6d9d118f6105a3627b64a7949e1fb0b145879e (diff)
New upstream version 16.11.9upstream/16.11.9upstream-16.11-stable
Change-Id: Ia1ac246c53e5050b6a29d6952fb668ad6c782996 Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'lib/librte_hash')
-rw-r--r--lib/librte_hash/rte_cuckoo_hash.c6
-rw-r--r--lib/librte_hash/rte_cuckoo_hash.h2
2 files changed, 5 insertions, 3 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)
diff --git a/lib/librte_hash/rte_cuckoo_hash.h b/lib/librte_hash/rte_cuckoo_hash.h
index 1b8ffed8..dae3f4a3 100644
--- a/lib/librte_hash/rte_cuckoo_hash.h
+++ b/lib/librte_hash/rte_cuckoo_hash.h
@@ -161,7 +161,7 @@ struct rte_hash_key {
};
/* Variable key size */
char key[0];
-} __attribute__((aligned(KEY_ALIGNMENT)));
+};
/* All different signature compare functions */
enum rte_hash_sig_compare_function {