From mboxrd@z Thu Jan 1 00:00:00 1970 From: "De Lara Guarch, Pablo" Subject: Re: [PATCH v3 03/12] cryptodev: support security APIs Date: Tue, 10 Oct 2017 13:43:33 +0000 Message-ID: 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="us-ascii" Content-Transfer-Encoding: quoted-printable 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: Akhil Goyal , "dev@dpdk.org" Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 292801B30C for ; Tue, 10 Oct 2017 15:43:49 +0200 (CEST) In-Reply-To: <20171006181151.4758-4-akhil.goyal@nxp.com> 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" > -----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 >=20 ... > 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; > } >=20 > +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 in= teger. Thanks, Pablo