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 47891A0350; Mon, 29 Jun 2020 11:57:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 25FCD1B13C; Mon, 29 Jun 2020 11:57:19 +0200 (CEST) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by dpdk.org (Postfix) with ESMTP id 1CCA81023 for ; Mon, 29 Jun 2020 11:57:18 +0200 (CEST) X-Originating-IP: 86.246.31.132 Received: from u256.net (lfbn-idf2-1-566-132.w86-246.abo.wanadoo.fr [86.246.31.132]) (Authenticated sender: grive@u256.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 11AF7E000C; Mon, 29 Jun 2020 09:57:16 +0000 (UTC) Date: Mon, 29 Jun 2020 11:57:11 +0200 From: =?utf-8?Q?Ga=C3=ABtan?= Rivet To: Maxime Coquelin Cc: dev@dpdk.org, david.marchand@redhat.com, wenzhuo.lu@intel.com, beilei.xing@intel.com, bernard.iremonger@intel.com Message-ID: <20200629095711.4fn2gqlxst2meo4g@u256.net> References: <20200625080430.1392037-1-maxime.coquelin@redhat.com> <20200625080430.1392037-3-maxime.coquelin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200625080430.1392037-3-maxime.coquelin@redhat.com> Subject: Re: [dpdk-dev] [PATCH v2 (v20.11) 2/2] eal: improve device probing API 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" On 25/06/20 10:04 +0200, Maxime Coquelin wrote: > This patch makes rte_dev_probe() to return the > rte_device pointer on success and NULL on error > instead of returning 0 on success and negative > value on error. > > The goal is to avoid that the calling application > iterates the devices list afterwards to retrieve > the pointer. Retrieving the pointer is required > for calling rte_dev_remove() later. > > Signed-off-by: Maxime Coquelin > --- > app/test-pmd/testpmd.c | 2 +- > drivers/net/failsafe/failsafe.c | 5 +++-- > lib/librte_eal/common/eal_common_dev.c | 18 ++++++++++-------- > lib/librte_eal/include/rte_dev.h | 4 ++-- > 4 files changed, 16 insertions(+), 13 deletions(-) > [...] > diff --git a/lib/librte_eal/include/rte_dev.h b/lib/librte_eal/include/rte_dev.h > index c8d985fb5c..9cf7c7fd71 100644 > --- a/lib/librte_eal/include/rte_dev.h > +++ b/lib/librte_eal/include/rte_dev.h > @@ -148,9 +148,9 @@ int rte_eal_hotplug_add(const char *busname, const char *devname, > * @param devargs > * Device arguments including bus, class and driver properties. > * @return > - * 0 on success, negative on error. > + * Generic device pointer on success, NULL on error. Hello Maxime, Do you plan on a v3 with rte_errno support in the new API or do you prefer to keep it this way after all? -- Gaƫtan