From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Conole Subject: [PATCH v2 13/25] eal: do not panic on memory init Date: Wed, 8 Feb 2017 13:51:30 -0500 Message-ID: <20170208185142.28678-14-aconole@redhat.com> References: <20170208185142.28678-1-aconole@redhat.com> Cc: Stephen Hemminger , Bruce Richardson To: dev@dpdk.org Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 1F1C5282 for ; Wed, 8 Feb 2017 19:51:51 +0100 (CET) In-Reply-To: <20170208185142.28678-1-aconole@redhat.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This can only happen when access to hugepages (either as primary or secondary process) fails (and that is usually permissions). Since the manner of failure is not reversible, we cannot allow retry. Signed-off-by: Aaron Conole --- lib/librte_eal/linuxapp/eal/eal.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index ec26153..f5f0ad4 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -842,8 +842,11 @@ rte_eal_init(int argc, char **argv) } #endif - if (rte_eal_memory_init() < 0) - rte_panic("Cannot init memory\n"); + if (rte_eal_memory_init() < 0) { + RTE_LOG(ERR, EAL, "Cannot init memory\n"); + rte_errno = EACCES; + return -1; + } /* the directories are locked during eal_hugepage_info_init */ eal_hugedirs_unlock(); -- 2.9.3