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 13043A0613 for ; Wed, 28 Aug 2019 12:10:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BCF211C212; Wed, 28 Aug 2019 12:10:05 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 228541BF9B for ; Wed, 28 Aug 2019 12:10:05 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us5.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 8F251A4005C; Wed, 28 Aug 2019 10:10:02 +0000 (UTC) Received: from [192.168.38.17] (91.220.146.112) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 28 Aug 2019 11:09:55 +0100 To: Jan Viktorin CC: Neil Horman , John McNamara , Marko Kovacevic , Thomas Monjalon , Ferruh Yigit , , Ivan Ilchenko References: <1566915962-5472-2-git-send-email-arybchenko@solarflare.com> <20190828115146.5812afa1@coaster.localdomain> From: Andrew Rybchenko Message-ID: Date: Wed, 28 Aug 2019 13:09:51 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190828115146.5812afa1@coaster.localdomain> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB X-Originating-IP: [91.220.146.112] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24874.003 X-TM-AS-Result: No-10.001500-8.000000-10 X-TMASE-MatchedRID: gzVbiXtWD9s4Q7K/HmUF53bspjK6JP6qJuDBbd4NSqQNWA0aQ3FdiCGU b2JNxi1qFm9c8s2OWMvSBOyM/pHn2nd1uJvxyvjSbrJ9gVnOsZ1gz2zq3DI3CV99KTJvos9IaGR LCnKSipVudZgDmiQl9fWTCYW+lKSUGrOScW34LBsD2WXLXdz+AekIk90rAX8hM/dZg2GSzOWQC8 z6UBv/aTBg5GAeGpcbhXVEO4CJZtBRhHeTkgZm5j8Ckw9b/GFeSoCG4sefl8RBbp4JobErAqOIr KL+ynQk9JSg/v8OYE/2Meo1KIrzyHnPiFSNe6xclrGv+knQDl8GchEhVwJY32AMM0WKD4asUS0x EYUYNYODWfNv+ApTBNtxq7Yo5FhMN68Ooe9V0NsoPrDxs+3NLDoSfZud5+GgT7zqZowzdpJSREF 97bqsBKv4jSzK/3BDSQv+FB+NQDrOwMvBLq50aszSKGx9g8xhfS0Ip2eEHny+qryzYw2E8LLn+0 Vm71Lcda/BQWxdCOYLbigRnpKlKSBuGJWwgxAr0t0ccteCeDf00seZRg8h5oYRi9M4VV4SvYqU9 Ui+OpRdOyZGRWPa18WFcyN1Agmm X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--10.001500-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24874.003 X-MDID: 1566987003-rDwA3xxvY59F 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 8/28/19 12:51 PM, Jan Viktorin wrote: > 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... The cover letter [1] was sent together with the patch. [1] http://mails.dpdk.org/archives/dev/2019-August/141593.html >> 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. I agree that dev_infos_get() callback should be mandatory, but what the function should do if the callback is not provided? I think that a sane default contents is more harm than an error (basically that's what we had before the patch). Since the function may return error, caller should take it into account anyway. Yes, some error codes could have special handling, but default error handling is required in any case.