From: Intel Date: Wed, 19 Dec 2012 23:00:00 +0000 (+0100) Subject: hash: allocate memory on right numa socket X-Git-Tag: spdx-start~11389 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=51bc66d50729608ca50ca4569a89695cd5c3de6d;p=dpdk.git hash: allocate memory on right numa socket Signed-off-by: Intel --- diff --git a/lib/librte_hash/rte_fbk_hash.c b/lib/librte_hash/rte_fbk_hash.c index fa397f5243..8128dfb17c 100644 --- a/lib/librte_hash/rte_fbk_hash.c +++ b/lib/librte_hash/rte_fbk_hash.c @@ -138,7 +138,8 @@ rte_fbk_hash_create(const struct rte_fbk_hash_params *params) return NULL; /* Allocate memory for table. */ - ht = (struct rte_fbk_hash_table *)rte_malloc(hash_name, mem_size, 0); + ht = (struct rte_fbk_hash_table *)rte_malloc_socket(hash_name, mem_size, + 0, params->socket_id); if (ht == NULL) return NULL; memset(ht, 0, mem_size); diff --git a/lib/librte_hash/rte_hash.c b/lib/librte_hash/rte_hash.c index 13958a3a55..e1a909aab1 100644 --- a/lib/librte_hash/rte_hash.c +++ b/lib/librte_hash/rte_hash.c @@ -213,8 +213,8 @@ rte_hash_create(const struct rte_hash_parameters *params) if (h != NULL) return NULL; - h = (struct rte_hash *)rte_zmalloc(hash_name, mem_size, - CACHE_LINE_SIZE); + h = (struct rte_hash *)rte_zmalloc_socket(hash_name, mem_size, + CACHE_LINE_SIZE, params->socket_id); if (h == NULL) { RTE_LOG(ERR, HASH, "memory allocation failed\n"); return NULL;