From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 3ABBE236 for ; Thu, 5 Oct 2017 10:49:23 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Oct 2017 01:49:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,480,1500966000"; d="scan'208";a="319829083" Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99]) by fmsmga004.fm.intel.com with ESMTP; 05 Oct 2017 01:49:20 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.167]) by IRSMSX107.ger.corp.intel.com ([169.254.10.65]) with mapi id 14.03.0319.002; Thu, 5 Oct 2017 09:49:19 +0100 From: "De Lara Guarch, Pablo" To: Akhil Goyal , "dev@dpdk.org" 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" , "olivier.matz@6wind.com" Thread-Topic: [PATCH v2 03/12] cryptodev: extend cryptodev to support security APIs Thread-Index: AQHTPEn01e3xI0uAFEuNbhToW7TY1KLU8mcQ Date: Thu, 5 Oct 2017 08:49:19 +0000 Message-ID: References: <20170914082651.26232-1-akhil.goyal@nxp.com> <20171003131413.23846-1-akhil.goyal@nxp.com> <20171003131413.23846-4-akhil.goyal@nxp.com> In-Reply-To: <20171003131413.23846-4-akhil.goyal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTMyYTcyOWEtZjVkNy00Zjk1LWEyMTEtZjgwNzU1NDA5Y2RkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IkNtbEo3UkUrOHFyckxBNmxFYU9sQVpIUFVoMms5K3VmblNDNllWY085OXc9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 03/12] cryptodev: extend cryptodev to support security APIs 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: , X-List-Received-Date: Thu, 05 Oct 2017 08:49:23 -0000 > -----Original Message----- > From: Akhil Goyal [mailto:akhil.goyal@nxp.com] > Sent: Tuesday, October 3, 2017 2:14 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 > ; olivier.matz@6wind.com > Subject: [PATCH v2 03/12] cryptodev: extend cryptodev to support security > APIs >=20 I would change the title to something a bit shorter "cryptodev: support sec= urity APIs"? No need to duplicate "cryptodev". > security ops are added to crypto device to support protocol offloaded > security operations. >=20 > Signed-off-by: Akhil Goyal > Signed-off-by: Declan Doherty > --- ... > diff --git a/lib/librte_cryptodev/rte_cryptodev.c > b/lib/librte_cryptodev/rte_cryptodev.c > index 327d7e8..e52fc88 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 -1; The return value of this function is uint16_t, but you are returning a -1 if the crypto device does not support security sessions. > +} > + > int > rte_cryptodev_socket_id(uint8_t dev_id) { diff --git > a/lib/librte_cryptodev/rte_cryptodev.h > b/lib/librte_cryptodev/rte_cryptodev.h > index 7ec9c4b..867b5be 100644 > --- a/lib/librte_cryptodev/rte_cryptodev.h > +++ b/lib/librte_cryptodev/rte_cryptodev.h > @@ -51,8 +51,6 @@ extern "C" { > #include > #include >=20 > -extern const char **rte_cyptodev_names; > - I think this removal deserves another patch, separate from this patchset. > /* Logging Macros */ >=20 > #define CDEV_LOG_ERR(...) \ > @@ -351,6 +349,8 @@ rte_cryptodev_get_aead_algo_enum(enum > rte_crypto_aead_algorithm *algo_enum, /**< Utilises CPU NEON > instructions */ > #define RTE_CRYPTODEV_FF_CPU_ARM_CE (1ULL << 11) > /**< Utilises ARM CPU Cryptographic Extensions */ > +#define RTE_CRYPTODEV_FF_SECURITY (1ULL << 12) > +/**< Support Security Protocol Processing */ >=20 >=20 > /** > @@ -761,6 +761,9 @@ struct rte_cryptodev { > /**< Flag indicating the device is attached */ } > __rte_cache_aligned; >=20 > +uint16_t > +rte_cryptodev_get_sec_id(uint8_t dev_id); > + > /** > * > * The data part, with no function pointers, associated with each device= . > @@ -789,6 +792,7 @@ struct rte_cryptodev_data { >=20 > void *dev_private; > /**< PMD-specific private data */ > + uint16_t sec_id; Add a description about "sec_id". > } __rte_cache_aligned; >=20