DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal: fix errno on service cores init failure
@ 2020-11-26 14:25 Olivier Matz
  2020-11-26 14:46 ` Van Haaren, Harry
  2021-01-13  8:28 ` [dpdk-dev] [PATCH v2] " Olivier Matz
  0 siblings, 2 replies; 6+ messages in thread
From: Olivier Matz @ 2020-11-26 14:25 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Jerin Jacob, Harry van Haaren, 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 <olivier.matz@6wind.com>
---
 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-14 15:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-26 14:25 [dpdk-dev] [PATCH] eal: fix errno on service cores init failure Olivier Matz
2020-11-26 14:46 ` Van Haaren, Harry
2020-11-26 16:37   ` Olivier Matz
2020-11-26 16:42     ` Van Haaren, Harry
2021-01-13  8:28 ` [dpdk-dev] [PATCH v2] " Olivier Matz
2021-01-14 15:52   ` [dpdk-dev] [dpdk-stable] " David Marchand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).