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 2B190A04B5; Wed, 13 Jan 2021 09:29:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF27D140E7D; Wed, 13 Jan 2021 09:29:20 +0100 (CET) Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by mails.dpdk.org (Postfix) with ESMTP id 46D85140E74 for ; Wed, 13 Jan 2021 09:29:19 +0100 (CET) Received: by mail-wm1-f48.google.com with SMTP id y187so765513wmd.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=nT13u2exS/ctQb65oWJn/LBKDBU/HzG1YHpAyyt2G2Se0ZyX9x19tE6aP4QtAJIWCG cDWVM02JIonISaVxTcXgKkbt9EFWOLdtW4+yRj7xnqvNU7bPUtPuzfRdD6sHWS4vumVi BNTnJbbkESoCr/zsF1GqzWYqq8e2GbR8VGfm/Wzs7ZwondsWUBUQtNMzbHY4yWW5WGsN ka0VNg4Ukzvklyy+wmPGp6Yv/wuHf9SIPjrXAdncuV40jVjHwFfVvQlS84IOUtfGsKC4 ZGG3aqRsN4FRtm3+0c24a/BIPz+7lR5WlGI1T+UjuX2d3XccHoy04t8kq6bDcbQNea5G g0lA== X-Gm-Message-State: AOAM531z5WvNdWIhexxj4W17r/wjIil9nJmWFfzt/uIneS/o4m2B3aXE 9k5bsIvOIv35LCN3wu/QKJlUdqHYKVkGGw== 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-dev] [PATCH v2] eal: fix errno on service cores init failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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