From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id ED6CEA0471
	for <public@inbox.dpdk.org>; Thu, 18 Jul 2019 11:34:54 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id A11C21DBE;
	Thu, 18 Jul 2019 11:34:54 +0200 (CEST)
Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com
 [64.147.123.20]) by dpdk.org (Postfix) with ESMTP id 44867137C
 for <dev@dpdk.org>; Thu, 18 Jul 2019 11:34:53 +0200 (CEST)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailout.west.internal (Postfix) with ESMTP id 552F841A;
 Thu, 18 Jul 2019 05:34:52 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute1.internal (MEProxy); Thu, 18 Jul 2019 05:34:52 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding; s=mesmtp; bh=ns5+cu+fBpESBbEf/gl2+Ji
 oU3NSovGGsIsopKOl1Ok=; b=D0ntda4ocVEWCk9Ji18g6Ms7/Uj+gE+ltBmBjOh
 NzPRbm7oCxgzLOAwKIDK7PvE/NZFerXau5PCDcsrz7VOGqAbFwAhv2TohvAWybje
 LfJbKjEPNHoegHckCifqQY82YzRXy1SNYmUv+JJ98xQ6kMNy0QAOyOvj8ZnkfAgw
 Cs+M=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:date:from
 :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=ns5+cu+fBpESBbEf/
 gl2+JioU3NSovGGsIsopKOl1Ok=; b=PZaG1D+gEdIwJZxGUeL6lZi9zemXwPRM2
 wRsmq1xx/IVnztaompbQM6/Iom3K6CcRIA0cl/E/NQgoQl+yTcHHXsjcQQPF6Glo
 bHa9LauhC+2K7FJ6EZKlnIQjTlgk4lxzK1n738ZnLCzIL4bTDKk6gZ4XR2asN1HE
 DK6L3jqy/JqdrWb6MUeZbdlCLAm7yGXNLDMLDJs+SJgS4ya96wZsVTc7Jhdjuccw
 OBr8ltImucWwNN8zLcQRQh2jY2tOkkCESy7pMfU7ayWwL5TdDCoCsa8QA5nlpLX7
 bEPF8w/kWTK50HS8bc4E6kCfcxo9//n7M/hKXQsu1ibK8X93wkn+A==
X-ME-Sender: <xms:Oz0wXdLgRJG30LgzYNlaO6-E0kpSSWIemlFLQwzSueAmR6NJakDLiw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrieehgddukecutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffoggfgsedtkeertdertd
 dtnecuhfhrohhmpefvhhhomhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhn
 jhgrlhhonhdrnhgvtheqnecukfhppeejjedrudefgedrvddtfedrudekgeenucfrrghrrg
 hmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvthenucevlhhu
 shhtvghrufhiiigvpedt
X-ME-Proxy: <xmx:Oz0wXbcJ4rYmUP1x_ryXVtLBjIEOi7NPS19nSUg_RWTI4RDvnjLPPA>
 <xmx:Oz0wXUbqf7ZpTrpEnPBCAZKUBmtPJBC-ribhYw3S0pshRVrN76tiGQ>
 <xmx:Oz0wXbW5psYp6e_XRk4Z-dwtMEA7-YQa_lps5NqIJcrIweDu95MmlQ>
 <xmx:Oz0wXZz-XuHpULrHStcY4wFde1nxE1S6z3spJLVs5eXFO27W3fTNtg>
Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184])
 by mail.messagingengine.com (Postfix) with ESMTPA id 07F1C380076;
 Thu, 18 Jul 2019 05:34:50 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: anatoly.burakov@intel.com
Cc: dev@dpdk.org
Date: Thu, 18 Jul 2019 11:34:32 +0200
Message-Id: <20190718093432.14092-1-thomas@monjalon.net>
X-Mailer: git-send-email 2.21.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [dpdk-dev] [PATCH] eal: warn on --no-huge allocation requirement
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

When using --no-huge mode, dynamic allocation is not supported.
Because of this limitation, the option --legacy-mem is implied
and -m may be needed to specify the amount of memory to allocate.
Otherwise the default amount MEMSIZE_IF_NO_HUGE_PAGE will be allocated.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 lib/librte_eal/common/eal_common_options.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index 512d5088e..4a76929ea 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -1551,6 +1551,10 @@ eal_check_common_options(struct internal_config *internal_cfg)
 			"be specified at the same time\n");
 		return -1;
 	}
+	if (internal_cfg->no_hugetlbfs && internal_cfg->memory == 0) {
+		RTE_LOG(NOTICE, EAL, "Option --"OPT_NO_HUGE" uses legacy mode, "
+			"option -m would override default memory allocation\n");
+	}
 	if (internal_cfg->no_hugetlbfs && internal_cfg->force_sockets == 1) {
 		RTE_LOG(ERR, EAL, "Option --"OPT_SOCKET_MEM" cannot "
 			"be specified together with --"OPT_NO_HUGE"\n");
-- 
2.21.0