From: Sergio Gonzalez Monroy Date: Wed, 15 Jul 2015 10:12:00 +0000 (+0100) Subject: mem: fix initialization with --no-huge option X-Git-Tag: spdx-start~8751 X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=fc060aa614ca72576da2626ca74bcc6694d613c9 mem: fix initialization with --no-huge option After code rework from bellow commit, logic expects hugepage_sz field to always be set (ie. not zero value). When using --no-huge, this field was left unset defaulting to zero. Set hugepage_sz to RTE_PGSIZE_4K when using --no-huge. Fixes: b3dfffd962ecd ("mem: allow multiple page sizes to be requested") Signed-off-by: Sergio Gonzalez Monroy --- diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c index 33ebd0f3c5..a3242a518b 100644 --- a/lib/librte_eal/bsdapp/eal/eal_memory.c +++ b/lib/librte_eal/bsdapp/eal/eal_memory.c @@ -75,6 +75,7 @@ rte_eal_contigmem_init(void) addr = malloc(internal_config.memory); mcfg->memseg[0].phys_addr = (phys_addr_t)(uintptr_t)addr; mcfg->memseg[0].addr = addr; + mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K; mcfg->memseg[0].len = internal_config.memory; mcfg->memseg[0].socket_id = 0; return 0; diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c index e501c49bd7..4fd63bbb03 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memory.c +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c @@ -1069,6 +1069,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].hugepage_sz = RTE_PGSIZE_4K; mcfg->memseg[0].len = internal_config.memory; mcfg->memseg[0].socket_id = SOCKET_ID_ANY; return 0;