lpm: allocate memory on right numa socket
authorIntel <intel.com>
Wed, 19 Dec 2012 23:00:00 +0000 (00:00 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 25 Jul 2013 13:23:27 +0000 (15:23 +0200)
Signed-off-by: Intel
lib/librte_lpm/rte_lpm.c

index e846e66..f1c9892 100644 (file)
@@ -188,8 +188,8 @@ rte_lpm_create(const char *name, int socket_id, int max_rules,
                return NULL;
 
        /* Allocate memory to store the LPM data structures. */
-       lpm = (struct rte_lpm *)rte_zmalloc(mem_name, mem_size,
-                       CACHE_LINE_SIZE);
+       lpm = (struct rte_lpm *)rte_zmalloc_socket(mem_name, mem_size,
+                       CACHE_LINE_SIZE, socket_id);
        if (lpm == NULL) {
                RTE_LOG(ERR, LPM, "LPM memory allocation failed\n");
                return NULL;