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 0136CA04DD; Thu, 26 Nov 2020 17:37:13 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5801BC9F0; Thu, 26 Nov 2020 17:37:11 +0100 (CET) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id 6FCEFC9EA for ; Thu, 26 Nov 2020 17:37:10 +0100 (CET) Received: by mail-wr1-f65.google.com with SMTP id i2so2784010wrs.4 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=OVgnN1PTLv+7GESfzSnZWdp5iCCiKWztcPymSUxEmiyUVhYm33kqBfXGe4k503jMbT kG76gBAq2L251L4YToRg6FvUWly58mfXntwpCWe6MGDdcxSkefWMO9mkdNT+HSUn3Hy8 hjizPb+Scg1WlHH5/lu9lmU+s8oaQc5WubNvN10YP6wVGWU5gm1evTYRZ3HCNa2JAC4L 43H7QbzruJVFqSal6ueqOWjkXt3hOAGUPizuOBbwOlTmKQsWyxT3f9xjZg0LejIY6jPb oFRs6SWY4QFOk8hDKe/gp2u8T1QL4hEF0Pant04eQYKD+8f1am+4Hm6IC2UCsHxM6CDd 1vVA== X-Gm-Message-State: AOAM533Im1fC5XxP8GoiXl9T7C/meiQZJL74EBURbJgUTWh/lmBKDHt6 C7vFl8AjKsduKvFpxVFQxE3x3Q== 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-dev] [PATCH] eal: fix errno on service cores init failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 >