X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_table%2Frte_table_hash_lru.c;h=c9a8afd7d413fb6a2058f5e58c75478b19780850;hb=cf59b29bb9d908ea8bbc5d4597db9ddd0febef47;hp=f94c0a2e00167db5d46d68b55aa78514f86abc4f;hpb=5bc3c265cbae9485eef5534516ec9a7b1df475ff;p=dpdk.git diff --git a/lib/librte_table/rte_table_hash_lru.c b/lib/librte_table/rte_table_hash_lru.c index f94c0a2e00..c9a8afd7d4 100644 --- a/lib/librte_table/rte_table_hash_lru.c +++ b/lib/librte_table/rte_table_hash_lru.c @@ -36,6 +36,7 @@ #include #include +#include #include #include @@ -155,21 +156,21 @@ rte_table_hash_lru_create(void *params, int socket_id, uint32_t entry_size) /* Check input parameters */ if ((check_params_create(p) != 0) || (!rte_is_power_of_2(entry_size)) || - ((sizeof(struct rte_table_hash) % CACHE_LINE_SIZE) != 0) || - (sizeof(struct bucket) != (CACHE_LINE_SIZE / 2))) { + ((sizeof(struct rte_table_hash) % RTE_CACHE_LINE_SIZE) != 0) || + (sizeof(struct bucket) != (RTE_CACHE_LINE_SIZE / 2))) { return NULL; } /* Memory allocation */ - table_meta_sz = CACHE_LINE_ROUNDUP(sizeof(struct rte_table_hash)); - bucket_sz = CACHE_LINE_ROUNDUP(p->n_buckets * sizeof(struct bucket)); - key_sz = CACHE_LINE_ROUNDUP(p->n_keys * p->key_size); - key_stack_sz = CACHE_LINE_ROUNDUP(p->n_keys * sizeof(uint32_t)); - data_sz = CACHE_LINE_ROUNDUP(p->n_keys * entry_size); + table_meta_sz = RTE_CACHE_LINE_ROUNDUP(sizeof(struct rte_table_hash)); + bucket_sz = RTE_CACHE_LINE_ROUNDUP(p->n_buckets * sizeof(struct bucket)); + key_sz = RTE_CACHE_LINE_ROUNDUP(p->n_keys * p->key_size); + key_stack_sz = RTE_CACHE_LINE_ROUNDUP(p->n_keys * sizeof(uint32_t)); + data_sz = RTE_CACHE_LINE_ROUNDUP(p->n_keys * entry_size); total_size = table_meta_sz + bucket_sz + key_sz + key_stack_sz + data_sz; - t = rte_zmalloc_socket("TABLE", total_size, CACHE_LINE_SIZE, socket_id); + t = rte_zmalloc_socket("TABLE", total_size, RTE_CACHE_LINE_SIZE, socket_id); if (t == NULL) { RTE_LOG(ERR, TABLE, "%s: Cannot allocate %u bytes for hash table\n",