From: Intel Date: Tue, 12 Mar 2013 11:03:00 +0000 (+0100) Subject: mem: error if requesting more segments than MAX_MEMSEG X-Git-Tag: spdx-start~11291 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=dd61b34d580b4279a0c6c5f22304038ec44193ba;p=dpdk.git mem: error if requesting more segments than MAX_MEMSEG Signed-off-by: Intel --- diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c index 6a91f35f2a..ec43cdc386 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memory.c +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c @@ -970,6 +970,18 @@ rte_eal_hugepage_init(void) hugepage[i].memseg_id = j; } + if (i < nrpages) { + RTE_LOG(ERR, EAL, "Can only reserve %d pages " + "from %d requested\n" + "Current %s=%d is not enough\n" + "Please either increase it or request less amount " + "of memory.\n", + i, nrpages, RTE_STR(CONFIG_RTE_MAX_MEMSEG), + RTE_MAX_MEMSEG); + return (-ENOMEM); + } + + return 0;