From mboxrd@z Thu Jan 1 00:00:00 1970 From: Akhil Goyal Subject: Re: [PATCH v3 03/12] cryptodev: support security APIs Date: Sat, 21 Oct 2017 20:52:15 +0530 Message-ID: <9dabdf85-8bd5-26d7-25b2-3503772af2bf@nxp.com> References: <20171003131413.23846-1-akhil.goyal@nxp.com> <20171006181151.4758-1-akhil.goyal@nxp.com> <20171006181151.4758-4-akhil.goyal@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Cc: "Doherty, Declan" , "hemant.agrawal@nxp.com" , "Nicolau, Radu" , "borisp@mellanox.com" , "aviadye@mellanox.com" , "thomas@monjalon.net" , "sandeep.malik@nxp.com" , "jerin.jacob@caviumnetworks.com" , "Mcnamara, John" , "Ananyev, Konstantin" , "shahafs@mellanox.com" , "olivier.matz@6wind.com" To: "De Lara Guarch, Pablo" , "dev@dpdk.org" Return-path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0062.outbound.protection.outlook.com [104.47.32.62]) by dpdk.org (Postfix) with ESMTP id 425881B2EF for ; Sat, 21 Oct 2017 17:22:27 +0200 (CEST) In-Reply-To: Content-Language: en-US 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 Pablo, On 10/10/2017 7:13 PM, De Lara Guarch, Pablo wrote: > > >> -----Original Message----- >> From: Akhil Goyal [mailto:akhil.goyal@nxp.com] >> Sent: Friday, October 6, 2017 7:12 PM >> To: dev@dpdk.org >> Cc: Doherty, Declan ; De Lara Guarch, Pablo >> ; hemant.agrawal@nxp.com; Nicolau, >> Radu ; borisp@mellanox.com; >> aviadye@mellanox.com; thomas@monjalon.net; sandeep.malik@nxp.com; >> jerin.jacob@caviumnetworks.com; Mcnamara, John >> ; Ananyev, Konstantin >> ; shahafs@mellanox.com; >> olivier.matz@6wind.com >> Subject: [PATCH v3 03/12] cryptodev: support security APIs >> > > ... > >> diff --git a/lib/librte_cryptodev/rte_cryptodev.c >> b/lib/librte_cryptodev/rte_cryptodev.c >> index 327d7e8..7a7c936 100644 >> --- a/lib/librte_cryptodev/rte_cryptodev.c >> +++ b/lib/librte_cryptodev/rte_cryptodev.c >> @@ -488,6 +488,16 @@ rte_cryptodev_devices_get(const char >> *driver_name, uint8_t *devices, >> return count; >> } >> >> +uint16_t >> +rte_cryptodev_get_sec_id(uint8_t dev_id) { >> + if (rte_crypto_devices[dev_id].feature_flags & >> + RTE_CRYPTODEV_FF_SECURITY) >> + return rte_crypto_devices[dev_id].data->sec_id; >> + >> + return INVALID_SEC_ID; > > Is this better than returning an integer? > From a user point of view, I see better to check for negative, > and other similar functions, such as rte_cryptodev_get_dev_id, return an integer. > The API is replaced with another one in v4 which returns a pointer. Thanks, Akhil