From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B03E0A04B5 for ; Wed, 13 Jan 2021 09:29:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8A397140E74; Wed, 13 Jan 2021 09:29:20 +0100 (CET) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mails.dpdk.org (Postfix) with ESMTP id 0EACD140E74 for ; Wed, 13 Jan 2021 09:29:19 +0100 (CET) Received: by mail-wm1-f54.google.com with SMTP id y187so765500wmd.3 for ; Wed, 13 Jan 2021 00:29:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=y1dd3JyjM2t2UuADfDBFZIvqFz50JPn941JptK8amGs=; b=QuBi003xmCaiwm2NV2bgI8Xkt8g/Gi0Uu3G7d2CI5i+g6yb2H+i0XXoG9oozB3NsMI 6bWYH8Vk2cwzVbwuPKTKG83B6dG+IRpdNMeX3zO6l1X0itF8mnGPSQk11oCmghBEugeQ 1W9UgBtmuAoHi00cBiHM7T2IExm0ENTV0/SZRekQXIOJs+w2R5aanveOxLeKhaCKqqew 6MhqrnacPD4TXlojVOedPAa3WJNcWhqXgyH7Cvzos3D/gl0XAYI++GsWPAp/wkjCL2Ug YTP2PfLg+bEe+IXHZ63o4BvmmHx8hiXx7jGUQzkaLjugTKYO305IaGeIhIpyHSO3DkTe nRxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=y1dd3JyjM2t2UuADfDBFZIvqFz50JPn941JptK8amGs=; b=VGay5K9ImRLQC5BKAIc+0El/D5nFRVdUNeVdUKMo4iuP/TD95sjhpS37Y2evTZ8f4c lhocMzM8j7X4fr/dzssgAWc2RJNdkXr7idXLYOjTsEaVD5Mwukbz+KCeJpRI6JgSQqC0 HE2YJzAMRljTRGLCwY91rpvWpBSNM37K+hYhc/QsI+oEBawZIvWxSG2B96/CneyNk7/h B75cfuCvX86vE8C9nG9U8aXm1EOtgr0mB9hCPF0nL8BYGxvGGAnA/034+rz3R/xoIyCv NXJ+rJE83tGzEB3787RtSwhniKSeBjqHaY3L18pqfAMKbOi0RbNPdAT8iMCp0mQIqPz5 5Stw== X-Gm-Message-State: AOAM533Tue4F1Oqfy9XY0fAL67bSkjUX98FuKuPWZ5TtLmr7gvaJeaci ibHfZBtto40W1UrpUQbJDAmeDg== X-Google-Smtp-Source: ABdhPJx05U7cLZSmv0rUV+T5tqen09OSUlMz6AwfBPfdBqXo8vIGWYeGGjBOvza26LEBuFrqQ3I3jQ== X-Received: by 2002:a1c:6383:: with SMTP id x125mr1044543wmb.46.1610526558701; Wed, 13 Jan 2021 00:29:18 -0800 (PST) Received: from gojira.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id d191sm1740926wmd.24.2021.01.13.00.29.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 00:29:17 -0800 (PST) From: Olivier Matz To: dev@dpdk.org Cc: bruce.richardson@intel.com, harry.van.haaren@intel.com, jerin.jacob@caviumnetworks.com, stable@dpdk.org Date: Wed, 13 Jan 2021 09:28:06 +0100 Message-Id: <20210113082805.5945-1-olivier.matz@6wind.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201126142523.25198-1-olivier.matz@6wind.com> References: <20201126142523.25198-1-olivier.matz@6wind.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH v2] eal: fix errno on service cores init failure X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 Acked-by: Harry van Haaren --- v2 * rebase on top of main branch * add same change for windows lib/librte_eal/freebsd/eal.c | 4 ++-- lib/librte_eal/linux/eal.c | 4 ++-- lib/librte_eal/windows/eal.c | 6 ++++-- 3 files changed, 8 insertions(+), 6 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; } diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c index 105549de1b..1e5f6576f0 100644 --- a/lib/librte_eal/windows/eal.c +++ b/lib/librte_eal/windows/eal.c @@ -264,6 +264,7 @@ rte_eal_init(int argc, char **argv) const struct rte_config *config = rte_eal_get_configuration(); struct internal_config *internal_conf = eal_get_internal_configuration(); + int ret; rte_eal_log_init(NULL, 0); @@ -387,9 +388,10 @@ rte_eal_init(int argc, char **argv) } /* Initialize services so drivers can register services during probe. */ - if (rte_service_init()) { + ret = rte_service_init(); + if (ret) { rte_eal_init_alert("rte_service_init() failed"); - rte_errno = ENOEXEC; + rte_errno = -ret; return -1; } -- 2.29.2