> -----Original Message----- > From: Olivier Matz <[email protected]> > Sent: Thursday, November 26, 2020 4:37 PM > To: Van Haaren, Harry <[email protected]> > Cc: [email protected]; Richardson, Bruce <[email protected]>; Jerin Jacob > <[email protected]>; [email protected] > 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 <[email protected]> > > > Sent: Thursday, November 26, 2020 2:25 PM > > > To: [email protected] > > > Cc: Richardson, Bruce <[email protected]>; Jerin Jacob > > > <[email protected]>; Van Haaren, Harry > > > <[email protected]>; [email protected] > > > 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: [email protected] > > > > > > Signed-off-by: Olivier Matz <[email protected]> > > > > 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 <[email protected]> > > > > > > > --- > > > 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!

