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

* Re: [dpdk-dev] [PATCH] eal: fix errno on service cores init failure
  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
  2021-01-13  8:28 ` [dpdk-dev] [PATCH v2] " Olivier Matz
  1 sibling, 1 reply; 6+ messages in thread
From: Van Haaren, Harry @ 2020-11-26 14:46 UTC (permalink / raw)
  To: Olivier Matz, dev; +Cc: Richardson, Bruce, Jerin Jacob, stable

> -----Original Message-----
> From: Olivier Matz <olivier.matz@6wind.com>
> Sent: Thursday, November 26, 2020 2:25 PM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; Jerin Jacob
> <jerin.jacob@caviumnetworks.com>; Van Haaren, Harry
> <harry.van.haaren@intel.com>; stable@dpdk.org
> Subject: [PATCH] eal: fix errno on service cores init failure
> 
> 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.

Should the above read as "does NOT describe" .. ?

> Fixes: e39824500825 ("service: initialize with EAL")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>

Few comments below, assuming agree on those, add my Ack on v2?

Checked, -ENOMEM and -EALREADY are returned today, which seem
better descriptive terms. Thanks for fixing,

Acked-by: Harry van Haaren <harry.van.haaren@intel.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;
>  	}

Here we set   rte_errno   as   -ret,  as in rte_service_init() we return the negative, e.g.   -ENOMEM.
Perhaps it is cleaner to to return ENOMEM from rte_service_init(), and avoid the duplicate negation?

rte_service_init() is not exported publicly in the .map file, so is internal only, and hence not an ABI break.


> @@ -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

* Re: [dpdk-dev] [PATCH] eal: fix errno on service cores init failure
  2020-11-26 14:46 ` Van Haaren, Harry
@ 2020-11-26 16:37   ` Olivier Matz
  2020-11-26 16:42     ` Van Haaren, Harry
  0 siblings, 1 reply; 6+ messages in thread
From: Olivier Matz @ 2020-11-26 16:37 UTC (permalink / raw)
  To: Van Haaren, Harry; +Cc: dev, Richardson, Bruce, Jerin Jacob, stable

Hi Harry,

On Thu, Nov 26, 2020 at 02:46:30PM +0000, Van Haaren, Harry wrote:
> > -----Original Message-----
> > From: Olivier Matz <olivier.matz@6wind.com>
> > Sent: Thursday, November 26, 2020 2:25 PM
> > To: dev@dpdk.org
> > Cc: Richardson, Bruce <bruce.richardson@intel.com>; Jerin Jacob
> > <jerin.jacob@caviumnetworks.com>; Van Haaren, Harry
> > <harry.van.haaren@intel.com>; stable@dpdk.org
> > Subject: [PATCH] eal: fix errno on service cores init failure
> > 
> > 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.
> 
> Should the above read as "does NOT describe" .. ?
> 
> > Fixes: e39824500825 ("service: initialize with EAL")
> > Cc: stable@dpdk.org
> > 
> > Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> 
> Few comments below, assuming agree on those, add my Ack on v2?
> 
> Checked, -ENOMEM and -EALREADY are returned today, which seem
> better descriptive terms. Thanks for fixing,
> 
> Acked-by: Harry van Haaren <harry.van.haaren@intel.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;
> >  	}
> 
> Here we set   rte_errno   as   -ret,  as in rte_service_init() we return the negative, e.g.   -ENOMEM.
> Perhaps it is cleaner to to return ENOMEM from rte_service_init(), and avoid the duplicate negation?
> 
> rte_service_init() is not exported publicly in the .map file, so is internal only, and hence not an ABI break.

I think returning -errno is common in dpdk, so I'll keep it like
this. Or it can eventually return -1 and set rte_errno.

> 
> 
> > @@ -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

* Re: [dpdk-dev] [PATCH] eal: fix errno on service cores init failure
  2020-11-26 16:37   ` Olivier Matz
@ 2020-11-26 16:42     ` Van Haaren, Harry
  0 siblings, 0 replies; 6+ messages in thread
From: Van Haaren, Harry @ 2020-11-26 16:42 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, Richardson, Bruce, Jerin Jacob, stable

> -----Original Message-----
> From: Olivier Matz <olivier.matz@6wind.com>
> Sent: Thursday, November 26, 2020 4:37 PM
> To: Van Haaren, Harry <harry.van.haaren@intel.com>
> Cc: dev@dpdk.org; Richardson, Bruce <bruce.richardson@intel.com>; Jerin Jacob
> <jerin.jacob@caviumnetworks.com>; stable@dpdk.org
> Subject: Re: [PATCH] eal: fix errno on service cores init failure
> 
> Hi Harry,
> 
> On Thu, Nov 26, 2020 at 02:46:30PM +0000, Van Haaren, Harry wrote:
> > > -----Original Message-----
> > > From: Olivier Matz <olivier.matz@6wind.com>
> > > Sent: Thursday, November 26, 2020 2:25 PM
> > > To: dev@dpdk.org
> > > Cc: Richardson, Bruce <bruce.richardson@intel.com>; Jerin Jacob
> > > <jerin.jacob@caviumnetworks.com>; Van Haaren, Harry
> > > <harry.van.haaren@intel.com>; stable@dpdk.org
> > > Subject: [PATCH] eal: fix errno on service cores init failure
> > >
> > > 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.
> >
> > Should the above read as "does NOT describe" .. ?
> >
> > > Fixes: e39824500825 ("service: initialize with EAL")
> > > Cc: stable@dpdk.org
> > >
> > > Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> >
> > Few comments below, assuming agree on those, add my Ack on v2?
> >
> > Checked, -ENOMEM and -EALREADY are returned today, which seem
> > better descriptive terms. Thanks for fixing,
> >
> > Acked-by: Harry van Haaren <harry.van.haaren@intel.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;
> > >  	}
> >
> > Here we set   rte_errno   as   -ret,  as in rte_service_init() we return the negative,
> e.g.   -ENOMEM.
> > Perhaps it is cleaner to to return ENOMEM from rte_service_init(), and avoid the
> duplicate negation?
> >
> > rte_service_init() is not exported publicly in the .map file, so is internal only, and
> hence not an ABI break.
> 
> I think returning -errno is common in dpdk, so I'll keep it like
> this. Or it can eventually return -1 and set rte_errno.

OK, fine with as is too, minor thing, thanks!

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

* [dpdk-dev] [PATCH v2] eal: fix errno on service cores init failure
  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
@ 2021-01-13  8:28 ` Olivier Matz
  2021-01-14 15:52   ` [dpdk-dev] [dpdk-stable] " David Marchand
  1 sibling, 1 reply; 6+ messages in thread
From: Olivier Matz @ 2021-01-13  8:28 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, harry.van.haaren, jerin.jacob, 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>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
---

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


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

* Re: [dpdk-dev] [dpdk-stable] [PATCH v2] eal: fix errno on service cores init failure
  2021-01-13  8:28 ` [dpdk-dev] [PATCH v2] " Olivier Matz
@ 2021-01-14 15:52   ` David Marchand
  0 siblings, 0 replies; 6+ messages in thread
From: David Marchand @ 2021-01-14 15:52 UTC (permalink / raw)
  To: Olivier Matz
  Cc: dev, Bruce Richardson, Van Haaren Harry, Jerin Jacob, dpdk stable

On Wed, Jan 13, 2021 at 9:29 AM Olivier Matz <olivier.matz@6wind.com> wrote:
>
> 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>
> Acked-by: Harry van Haaren <harry.van.haaren@intel.com>

Applied, thanks.


-- 
David Marchand


^ 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).