summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAdrien Mazarguil <adrien.mazarguil@6wind.com>2013-02-21 17:39:23 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-01-15 18:08:44 +0100
commit4fdeb8b50cc9ed1a059ec2835ed2e25bcb3cb215 (patch)
tree83901834ca11bc5d9133ba9c180c83cf82c99a2e /lib
parent73114029ab6d9d75ee02613b342036f4abc52cbb (diff)
downloaddpdk-4fdeb8b50cc9ed1a059ec2835ed2e25bcb3cb215.zip
dpdk-4fdeb8b50cc9ed1a059ec2835ed2e25bcb3cb215.tar.gz
dpdk-4fdeb8b50cc9ed1a059ec2835ed2e25bcb3cb215.tar.xz
mem: get memzone from any CPU socket when hugepages are disabled
When huge pages are disabled, memory is allocated for a single, undefined CPU socket using malloc(), causing rte_memzone_reserve_aligned() to fail most of the time. This patch causes that memory to use SOCKET_ID_ANY instead of 0, and allow it to be used in place of any socket ID specified by user. Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> Acked-by: Damien Millescamps <damien.millescamps@6wind.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/librte_eal/common/eal_common_memzone.c1
-rw-r--r--lib/librte_eal/linuxapp/eal/eal_memory.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/librte_eal/common/eal_common_memzone.c b/lib/librte_eal/common/eal_common_memzone.c
index 35cee81..f036621 100644
--- a/lib/librte_eal/common/eal_common_memzone.c
+++ b/lib/librte_eal/common/eal_common_memzone.c
@@ -154,6 +154,7 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len,
/* bad socket ID */
if (socket_id != SOCKET_ID_ANY &&
+ free_memseg[i].socket_id != SOCKET_ID_ANY &&
socket_id != free_memseg[i].socket_id)
continue;
diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 860097c..b538020 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -735,7 +735,7 @@ rte_eal_hugepage_init(void)
mcfg->memseg[0].phys_addr = (phys_addr_t)(uintptr_t)addr;
mcfg->memseg[0].addr = addr;
mcfg->memseg[0].len = internal_config.memory;
- mcfg->memseg[0].socket_id = 0;
+ mcfg->memseg[0].socket_id = SOCKET_ID_ANY;
return 0;
}