From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavan Nikhilesh Bhagavatula Subject: Re: [PATCH] cryptodev: fix cryptodev start return value Date: Thu, 8 Jun 2017 13:42:43 +0530 Message-ID: <20170608081242.GA19599@PBHAGAVATULA-LT> References: <1496831804-28265-1-git-send-email-pbhagavatula@caviumnetworks.com> <348A99DA5F5B7549AA880327E580B43589219317@IRSMSX101.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Doherty, Declan" , Pavan Nikhilesh To: "dev@dpdk.org" , "Trahe, Fiona" Return-path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0081.outbound.protection.outlook.com [104.47.34.81]) by dpdk.org (Postfix) with ESMTP id 6E17E2BB8 for ; Thu, 8 Jun 2017 10:13:07 +0200 (CEST) Content-Disposition: inline In-Reply-To: <348A99DA5F5B7549AA880327E580B43589219317@IRSMSX101.ger.corp.intel.com> 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 Wed, Jun 07, 2017 at 03:54:23PM +0000, Trahe, Fiona wrote: > Hi Pavan, > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pavan Nikhilesh > > Sent: Wednesday, June 7, 2017 11:37 AM > > To: dev@dpdk.org > > Cc: Doherty, Declan ; Pavan Nikhilesh Bhagavatula > > > > Subject: [dpdk-dev] [PATCH] cryptodev: fix cryptodev start return value > > > > From: Pavan Nikhilesh Bhagavatula > > > > If cryptodev has already started it should return -EBUSY instead of 0 > > when rte_cryptodev_start is called. > > > > Fixes: d11b0f30df88 ("cryptodev: introduce API and framework for crypto devices") > > > > Signed-off-by: Pavan Nikhilesh > > --- > > lib/librte_cryptodev/rte_cryptodev.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c > > index b65cd9c..c815038 100644 > > --- a/lib/librte_cryptodev/rte_cryptodev.c > > +++ b/lib/librte_cryptodev/rte_cryptodev.c > > @@ -1000,7 +1000,7 @@ rte_cryptodev_start(uint8_t dev_id) > > if (dev->data->dev_started != 0) { > > CDEV_LOG_ERR("Device with dev_id=%" PRIu8 " already started", > > dev_id); > > - return 0; > > + return -EBUSY; > It makes sense to me to return 0/success in this case, as the end result is the > same, the device is successfully started. > But I don't feel strongly about it if there's a good argument for making the change? I do agree with this but from an application perspective when the API is called again after the device has already started (without calling the stop API) it would mean that there is an underlying issue with the application's business logic and it would go undetected, so I feel that we should strictly enforce this scenario as an error. > However, as it is an API change doesn't it need to be flagged in a release before the change is made? I don't think that this would be an API change as it doesn't deprecate the existing ABI. Any thoughts about this from the community are welcome as the same issue affects multiple core libraries (crytodev, ethdev, eventdev). > > > } > > > > diag = (*dev->dev_ops->dev_start)(dev); > > -- > > 2.7.4 >