From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 94D3AA052A for ; Thu, 26 Nov 2020 15:26:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5BDB5C98A; Thu, 26 Nov 2020 15:26:14 +0100 (CET) Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 1618CC974; Thu, 26 Nov 2020 15:26:10 +0100 (CET) Received: from glumotte.dev.6wind.com. (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id DB1B9497723; Thu, 26 Nov 2020 15:26:09 +0100 (CET) From: Olivier Matz To: dev@dpdk.org Cc: Bruce Richardson , Jerin Jacob , Harry van Haaren , stable@dpdk.org Date: Thu, 26 Nov 2020 15:25:23 +0100 Message-Id: <20201126142523.25198-1-olivier.matz@6wind.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH] eal: fix errno on service cores init failure X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Currently, when rte_service_init() fails at initialization, we see the following message: Cannot init EAL: Exec format error This error code does describe the real issue. Instead, use the error code returned by the function. Fixes: e39824500825 ("service: initialize with EAL") Cc: stable@dpdk.org Signed-off-by: Olivier Matz --- lib/librte_eal/freebsd/eal.c | 4 ++-- lib/librte_eal/linux/eal.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/librte_eal/freebsd/eal.c b/lib/librte_eal/freebsd/eal.c index d6ea023750..51478358c7 100644 --- a/lib/librte_eal/freebsd/eal.c +++ b/lib/librte_eal/freebsd/eal.c @@ -906,7 +906,7 @@ rte_eal_init(int argc, char **argv) ret = rte_service_init(); if (ret) { rte_eal_init_alert("rte_service_init() failed"); - rte_errno = ENOEXEC; + rte_errno = -ret; return -1; } @@ -922,7 +922,7 @@ rte_eal_init(int argc, char **argv) */ ret = rte_service_start_with_defaults(); if (ret < 0 && ret != -ENOTSUP) { - rte_errno = ENOEXEC; + rte_errno = -ret; return -1; } diff --git a/lib/librte_eal/linux/eal.c b/lib/librte_eal/linux/eal.c index a4161be630..32b48c3de9 100644 --- a/lib/librte_eal/linux/eal.c +++ b/lib/librte_eal/linux/eal.c @@ -1273,7 +1273,7 @@ rte_eal_init(int argc, char **argv) ret = rte_service_init(); if (ret) { rte_eal_init_alert("rte_service_init() failed"); - rte_errno = ENOEXEC; + rte_errno = -ret; return -1; } @@ -1295,7 +1295,7 @@ rte_eal_init(int argc, char **argv) */ ret = rte_service_start_with_defaults(); if (ret < 0 && ret != -ENOTSUP) { - rte_errno = ENOEXEC; + rte_errno = -ret; return -1; } -- 2.25.1