From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Conole Subject: [PATCH v3 07/25] eal: Signal error when CPU isn't supported Date: Thu, 9 Feb 2017 09:29:35 -0500 Message-ID: <20170209142953.8167-8-aconole@redhat.com> References: <20170208185142.28678-1-aconole@redhat.com> <20170209142953.8167-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 D10B5F965 for ; Thu, 9 Feb 2017 15:30:05 +0100 (CET) In-Reply-To: <20170209142953.8167-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" It's now possible to gracefully exit the application, or for applications which support non-dpdk datapaths working in concert with DPDK datapaths, there no longer is the possibility of exiting for unsupported CPUs. Signed-off-by: Aaron Conole --- lib/librte_eal/linuxapp/eal/eal.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index a626774..88d59a2 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -752,7 +752,11 @@ rte_eal_init(int argc, char **argv) char thread_name[RTE_MAX_THREAD_NAME_LEN]; /* checks if the machine is adequate */ - rte_cpu_check_supported(); + if (!rte_cpu_is_supported()) { + fprintf(stderr, "EAL: FATAL - unsupported cpu type.\n"); + rte_errno = ENOTSUP; + return -1; + } if (!rte_atomic32_test_and_set(&run_once)) return -1; -- 2.9.3