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 9AF03A0613 for ; Wed, 28 Aug 2019 11:50:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8A32F1C196; Wed, 28 Aug 2019 11:50:43 +0200 (CEST) Received: from office2.cesnet.cz (office2.cesnet.cz [195.113.144.244]) by dpdk.org (Postfix) with ESMTP id 534861C191 for ; Wed, 28 Aug 2019 11:50:42 +0200 (CEST) Received: from coaster.localdomain (unknown [IPv6:2001:67c:1220:80e:a9:edd0:2e93:a6c4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by office2.cesnet.cz (Postfix) with ESMTPSA id 44FD6400082; Wed, 28 Aug 2019 11:50:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cesnet.cz; s=office2; t=1566985841; bh=DdN+1NqfrIo52YgeiaqkWv4MT5VE4SFtrP7BJdCNGhk=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=UpDxYQoiqS3wbvegmp+19LwXvFZjC3Qej0Z8zvs3QS2BC1ENH/Pdr++FrNIODJghI wfHPX4Eh0wyTBKm/NFpXRkEqXUBtOhDW5o0Q4GiiwsBHswUzHTO1i5iMXdDd3+efHL 03ZzUrI2QRCFFFQEv8PTdFMXhCTJhx8U+uSjOSpY= Date: Wed, 28 Aug 2019 11:51:46 +0200 From: Jan Viktorin To: Andrew Rybchenko Cc: Neil Horman , John McNamara , Marko Kovacevic , Thomas Monjalon , Ferruh Yigit , , Ivan Ilchenko Message-ID: <20190828115146.5812afa1@coaster.localdomain> In-Reply-To: <1566915962-5472-2-git-send-email-arybchenko@solarflare.com> References: <1566915962-5472-2-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 01/51] ethdev: change rte_eth_dev_info_get() return value to int 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 Tue, 27 Aug 2019 15:25:12 +0100 Andrew Rybchenko wrote: > From: Ivan Ilchenko > > Change rte_eth_dev_info_get() return value from void to int and return > negative errno values in case of error conditions. > Modify rte_eth_dev_info_get() usage across the ethdev according > to new return type. Hello Andrew, I didn't find any cover letter describing the true intentions of this patchset. Anyway, see below a short comment... > > Signed-off-by: Ivan Ilchenko > Signed-off-by: Andrew Rybchenko > --- > doc/guides/rel_notes/deprecation.rst | 1 - > doc/guides/rel_notes/release_19_11.rst | 5 ++- > lib/librte_ethdev/rte_ethdev.c | 71 > ++++++++++++++++++++++++---------- lib/librte_ethdev/rte_ethdev.h > | 6 ++- 4 files changed, 60 insertions(+), 23 deletions(-) [...] > b/lib/librte_ethdev/rte_ethdev.h index dc6596b..09c278d 100644 > --- a/lib/librte_ethdev/rte_ethdev.h > +++ b/lib/librte_ethdev/rte_ethdev.h > @@ -2366,8 +2366,12 @@ int > rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, > * @param dev_info > * A pointer to a structure of type *rte_eth_dev_info* to be > filled with > * the contextual information of the Ethernet device. > + * @return > + * - (0) if successful. > + * - (-ENOTSUP) if support for dev_infos_get() does not exist for > the device. I believe that allowing PMDs to return -ENOTSUP is not a good idea. At the moment, all PMDs provides this kind of information. It is not always very reliable piece of information but for me, it is a piece of gold I would not like to loose when configuring devices. I think it should be mandatory for all PMDs to provide this function. Another possible way, give a sane default contents of this structure. But, please, do not return -ENOTSUP. Regards Jan > + * - (-ENODEV) if *port_id* invalid. > */ > -void rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info > *dev_info); +int rte_eth_dev_info_get(uint16_t port_id, struct > rte_eth_dev_info *dev_info); > /** > * Retrieve the firmware version of a device.