From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1A6BCA04DD for ; Thu, 26 Nov 2020 17:37:14 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E9FC6CA02; Thu, 26 Nov 2020 17:37:12 +0100 (CET) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id 76426C9F0 for ; Thu, 26 Nov 2020 17:37:10 +0100 (CET) Received: by mail-wr1-f67.google.com with SMTP id r3so2800902wrt.2 for ; Thu, 26 Nov 2020 08:37:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=PCF/3lTVfqBF1+vzv4Ty17fH0t1obHEmNuHEcwPOS3I=; b=avIozKLDgmvn+KwM8v7bIjKJh9y0bOijw/0E8WqYSlUnEPhWuLC3swbFjuIkg7lOb1 g6DWpnyXnskbkYVLS4e9D1uS+hNkB033t2HL+5p9YEnnWqRtfiCi9iyqyYdiUXEqckXQ wdHxVDjwKhqHaLzpwr69QYKsL2mZGVlcxN2b7IChqtCy5cUIsCGr+V4ggCfkp0lk/9Oc DYEgvwJyg4jMZJfqqRCrc0MvDAAx3Xdo+uXJTr8jw1KUI2oex3mk5cpq9dK3uQpyfZop tun2d0vq6hRbN48VaCPGDcuhmOkclH+7/LtNxwaYn/leBZExb01tQ2PIPNFkryk5fYom vIPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=PCF/3lTVfqBF1+vzv4Ty17fH0t1obHEmNuHEcwPOS3I=; b=QqA1Yj+Y2UOQ/W+jUXzzkewWL5mXKuif9Xef16daW6zbKckevgqYJwoSgrCsFqSfdS KifnB5a8Wu9P4BYAbERnJH+6p/7HIANKf0AUJmES881WmZ+IIUYXv6pTZtoHHtTAo17a cPJk4XYr73apReRxx/yYXk+xDddfIZ+toJve8YVaQ4WHUe68l0f3fY1As+mntpATXC+A GhW6qXBV+ZOGacyMAIUBdubovVW8E/aMbutX+uPwJt0kpiHAoVktpy8BCOvoxrlQ8epk M3q9pXzWyToG83GfsbbQq8CKaliR6BqpWntmctHpSiSz9C7SZVjvZRp+J+0N/pe4MIYL TA7w== X-Gm-Message-State: AOAM533pwHdhBTULAnWsN/XcITKEuICO+DC0g5Uj9TNPwf0hiKX4NH05 9vs90h02N4zUNtKXfNqSejjXqQ== X-Google-Smtp-Source: ABdhPJx+TR+W487XD+29ZhYdeTI3ZU8JyGyEzz/6CEU4hHzN79LoHkkgH8/WvSB8/D+s41vOeDp+2Q== X-Received: by 2002:adf:ff8e:: with SMTP id j14mr4874804wrr.48.1606408629170; Thu, 26 Nov 2020 08:37:09 -0800 (PST) Received: from 6wind.com (2a01cb0c0005a600345636f7e65ed1a0.ipv6.abo.wanadoo.fr. [2a01:cb0c:5:a600:3456:36f7:e65e:d1a0]) by smtp.gmail.com with ESMTPSA id z19sm9251716wmk.12.2020.11.26.08.37.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Nov 2020 08:37:08 -0800 (PST) Date: Thu, 26 Nov 2020 17:37:07 +0100 From: Olivier Matz To: "Van Haaren, Harry" Cc: "dev@dpdk.org" , "Richardson, Bruce" , Jerin Jacob , "stable@dpdk.org" Message-ID: <20201126163707.GA1898@platinum> References: <20201126142523.25198-1-olivier.matz@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [dpdk-stable] [PATCH] eal: fix errno on service cores init failure X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi Harry, On Thu, Nov 26, 2020 at 02:46:30PM +0000, Van Haaren, Harry wrote: > > -----Original Message----- > > From: Olivier Matz > > Sent: Thursday, November 26, 2020 2:25 PM > > To: dev@dpdk.org > > Cc: Richardson, Bruce ; Jerin Jacob > > ; Van Haaren, Harry > > ; 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 > > 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 > > > > --- > > 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 >