DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Van Haaren, Harry" <harry.van.haaren@intel.com>
To: Olivier Matz <olivier.matz@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Richardson, Bruce" <bruce.richardson@intel.com>,
	Jerin Jacob <jerin.jacob@caviumnetworks.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] eal: fix errno on service cores init failure
Date: Thu, 26 Nov 2020 14:46:30 +0000
Message-ID: <BYAPR11MB3143F08BE8ED158B9C7A2CB6D7F90@BYAPR11MB3143.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20201126142523.25198-1-olivier.matz@6wind.com>

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


  reply	other threads:[~2020-11-26 14:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-26 14:25 Olivier Matz
2020-11-26 14:46 ` Van Haaren, Harry [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BYAPR11MB3143F08BE8ED158B9C7A2CB6D7F90@BYAPR11MB3143.namprd11.prod.outlook.com \
    --to=harry.van.haaren@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=olivier.matz@6wind.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git