From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id E92B11D057 for ; Fri, 15 Jun 2018 11:05:09 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jun 2018 02:05:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,226,1526367600"; d="scan'208";a="47951067" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by fmsmga008.fm.intel.com with ESMTP; 15 Jun 2018 02:05:07 -0700 Received: from irsmsx111.ger.corp.intel.com (10.108.20.4) by irsmsx105.ger.corp.intel.com (163.33.3.28) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 15 Jun 2018 10:05:06 +0100 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.139]) by irsmsx111.ger.corp.intel.com ([169.254.2.230]) with mapi id 14.03.0319.002; Fri, 15 Jun 2018 10:05:06 +0100 From: "De Lara Guarch, Pablo" To: Shally Verma CC: "Trahe, Fiona" , "akhil.goyal@nxp.com" , "dev@dpdk.org" , "pathreya@caviumnetworks.com" , Sunila Sahu , Ashish Gupta Thread-Topic: [PATCH v3 2/6] lib/cryptodev: add asym op support in cryptodev Thread-Index: AQHT7Nv/6wi8085iwkqygU+t7M2ANqRhL2WQ Date: Fri, 15 Jun 2018 09:05:06 +0000 Message-ID: References: <1526450713-17299-1-git-send-email-shally.verma@caviumnetworks.com> <1526450713-17299-3-git-send-email-shally.verma@caviumnetworks.com> In-Reply-To: <1526450713-17299-3-git-send-email-shally.verma@caviumnetworks.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNGM0N2Y0ZjItNzQzZC00MzBjLWIyMzctNGVhODljMmQ3YTQ4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiNTYxTGtJZDlVNkx2cVwvWTZjWXdaRXJXeld4QVlLT1wvb3hSZlZINUpWdkttSlwvVGRcL3VrdlNiVDRKUFNnbW1nRlYifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 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 v3 2/6] lib/cryptodev: add asym op support in cryptodev 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: Fri, 15 Jun 2018 09:05:10 -0000 > -----Original Message----- > From: Shally Verma [mailto:shally.verma@caviumnetworks.com] > Sent: Wednesday, May 16, 2018 7:05 AM > To: De Lara Guarch, Pablo > Cc: Trahe, Fiona ; akhil.goyal@nxp.com; > dev@dpdk.org; pathreya@caviumnetworks.com; Sunila Sahu > ; Ashish Gupta > > Subject: [PATCH v3 2/6] lib/cryptodev: add asym op support in cryptodev Change title to "cryptodev: support asymmetric operations". >=20 > Extend DPDK librte_cryptodev to: > - define asym op type in rte_crypto_op_type and associated > op pool create/alloc APIs > - define asym session and associated session APIs >=20 > If PMD shows in its feature flag that it supports both sym and asym then = it must > support those on all its qps. >=20 > Changes from v2: > - added rte_cryptodev_asym_session_set/get_private_data for app to setup > private data in a session as per latest dpdk-next-crypto spec > - rename rte_cryptodev_get_asym_session_private_size to be consistent wit= h > other API names > - correct rte_cryptodev_asym_session_create to pass void** to > rte_mempool_get() and add for private_data_size flag >=20 > Changes from v1 > - resolve new line error in librte_cryptodev/rte_cryptodev_version.ma= p These changes should go after the three dashes after the "Signed-off-by" li= nes. >=20 > Signed-off-by: Shally Verma > Signed-off-by: Sunila Sahu > Signed-off-by: Ashish Gupta > --- > lib/librte_cryptodev/rte_crypto.h | 37 ++++- > lib/librte_cryptodev/rte_cryptodev.c | 180 +++++++++++++++++++= ++++++ > lib/librte_cryptodev/rte_cryptodev.h | 114 +++++++++++++++- > lib/librte_cryptodev/rte_cryptodev_pmd.h | 58 +++++++- > lib/librte_cryptodev/rte_cryptodev_version.map | 7 + > 5 files changed, 392 insertions(+), 4 deletions(-) >=20 > diff --git a/lib/librte_cryptodev/rte_crypto.h b/lib/librte_cryptodev/rte= _crypto.h > index 25404264b..ef9820e55 100644 > --- a/lib/librte_cryptodev/rte_crypto.h > +++ b/lib/librte_cryptodev/rte_crypto.h ... > + if (op->type =3D=3D RTE_CRYPTO_OP_TYPE_ASYMMETRIC) > + return (void *)((uint8_t *)(op+1) + For consistency, use (op + 1). ... > --- a/lib/librte_cryptodev/rte_cryptodev.c > +++ b/lib/librte_cryptodev/rte_cryptodev.c ... > /** Initialise rte_crypto_op mempool element */ static void > rte_crypto_op_init(struct rte_mempool *mempool, @@ -1303,6 +1476,13 @@ > rte_crypto_op_pool_create(const char *name, enum rte_crypto_op_type type, > sizeof(struct rte_crypto_sym_op) + > priv_size; >=20 I would check for type =3D=3D SYMMETRIC in the previous code, else if type =3D=3D ASYMMETRIC with this code, else log error and return NU= LL (or use a switch, whatever you prefer). > + if (type =3D=3D RTE_CRYPTO_OP_TYPE_ASYMMETRIC) { > + /* override size by size of asym op */ > + elt_size =3D sizeof(struct rte_crypto_op) + > + sizeof(struct rte_crypto_asym_op) + > + priv_size; > + } > + > /* lookup mempool in case already allocated */ > struct rte_mempool *mp =3D rte_mempool_lookup(name); >=20 > diff --git a/lib/librte_cryptodev/rte_cryptodev.h > b/lib/librte_cryptodev/rte_cryptodev.h > index 261a359dc..623459a95 100644 > --- a/lib/librte_cryptodev/rte_cryptodev.h > +++ b/lib/librte_cryptodev/rte_cryptodev.h ... > + */ > +int __rte_experimental > +rte_cryptodev_asym_session_set_private_data( > + struct rte_cryptodev_asym_session > *sess, > + void *data, > + uint16_t size) Missing ";" here. > + > +/** > + * Get private data of a session. > + * > + * @param sess Session pointer allocated by > + * *rte_cryptodev_asym_session_create*. > + * > + * @return > + * - On success return pointer to private data. > + * - On failure returns NULL. > + */ > +void * __rte_experimental > +rte_cryptodev_asym_session_get_private_data( > + struct rte_cryptodev_asym_session *sess) Missing ";" here. > + > + > #ifdef __cplusplus > } > #endif > diff --git a/lib/librte_cryptodev/rte_cryptodev_version.map > b/lib/librte_cryptodev/rte_cryptodev_version.map > index 560e46411..62b782444 100644 > --- a/lib/librte_cryptodev/rte_cryptodev_version.map > +++ b/lib/librte_cryptodev/rte_cryptodev_version.map > @@ -89,6 +89,13 @@ DPDK_17.11 { > EXPERIMENTAL { > global: >=20 > + rte_cryptodev_asym_get_private_session_size I see that there is not rte_cryptodev_asym_get_header_session_size. rte_cryptodev_get_header_session_size is deprecated, so you won't be able t= o use this API. > + rte_cryptodev_asym_session_clear; > + rte_cryptodev_asym_session_create; > + rte_cryptodev_asym_session_free; > + rte_cryptodev_asym_session_init; > + rte_cryptodev_asym_session_get_private_data > + rte_cryptodev_asym_session_set_private_data Missing ";" at the end of these two functions. Also, "asym_session_get_private_data" should be placed after "asym_session_= free". > rte_cryptodev_sym_session_get_private_data; > rte_cryptodev_sym_session_set_private_data; > } DPDK_17.11; > -- > 2.14.3