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 5C4741B559 for ; Sun, 17 Jun 2018 14:11:35 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jun 2018 05:11:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,234,1526367600"; d="scan'208";a="58245619" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by fmsmga002.fm.intel.com with ESMTP; 17 Jun 2018 05:11:31 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.139]) by IRSMSX152.ger.corp.intel.com ([163.33.192.66]) with mapi id 14.03.0319.002; Sun, 17 Jun 2018 13:11:31 +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 3/6] lib/cryptodev: add asymmetric crypto capability in cryptodev Thread-Index: AQHT7NwI8RvyiXxckkKNJ504cumkdqRkheNQ Date: Sun, 17 Jun 2018 12:11:30 +0000 Message-ID: References: <1526450713-17299-1-git-send-email-shally.verma@caviumnetworks.com> <1526450713-17299-4-git-send-email-shally.verma@caviumnetworks.com> In-Reply-To: <1526450713-17299-4-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDE5MmEzMzMtYjYwNS00YmM4LWE3MDItZDE1MzNhYjUwMWMxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidXI4S1k2S1NiMkJHcWVhQzR0UTFNMW9mNjdKZXNzTkxLemNqOTRLRFFveGFsVHRRaUJUZkQ4dThwcVM1bXhBXC8ifQ== 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 3/6] lib/cryptodev: add asymmetric crypto capability 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: Sun, 17 Jun 2018 12:11:35 -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 3/6] lib/cryptodev: add asymmetric crypto capability i= n > cryptodev >=20 > Extend cryptodev with asymmetric capability APIs and definitions. >=20 > changes from v2: > - remove redundant xform_type from asym capability struct > - rename rte_cryptodev_get_asym_xform_enum to be more consistent with > other API names >=20 > Signed-off-by: Shally Verma > Signed-off-by: Sunila Sahu > Signed-off-by: Ashish Gupta >=20 > --- > User must apply patch > "lib/cryptodev: add asymmetric algos in cryptodev" before compilation > --- > --- > lib/librte_cryptodev/Makefile | 1 + > lib/librte_cryptodev/rte_cryptodev.c | 73 +++++++++++++++++ > lib/librte_cryptodev/rte_cryptodev.h | 107 +++++++++++++++++++= +++++- > lib/librte_cryptodev/rte_cryptodev_version.map | 11 ++- > 4 files changed, 186 insertions(+), 6 deletions(-) >=20 > diff --git a/lib/librte_cryptodev/Makefile b/lib/librte_cryptodev/Makefil= e index > 138e627dc..93f9d2d45 100644 > --- a/lib/librte_cryptodev/Makefile > +++ b/lib/librte_cryptodev/Makefile > @@ -12,6 +12,7 @@ LIBABIVER :=3D 4 > # build flags > CFLAGS +=3D -O3 > CFLAGS +=3D $(WERROR_FLAGS) > +CFLAGS +=3D -DALLOW_EXPERIMENTAL_API I don't think this flag is needed. You are exporting experimental API, but = not using inside the library (apps/drivers will need to use this flag, though). > LDLIBS +=3D -lrte_eal -lrte_mempool -lrte_ring -lrte_mbuf LDLIBS +=3D -= lrte_kvargs >=20 > diff --git a/lib/librte_cryptodev/rte_cryptodev.c > b/lib/librte_cryptodev/rte_cryptodev.c > index 4015872ed..ee76cef07 100644 > --- a/lib/librte_cryptodev/rte_cryptodev.c ... > +const struct rte_cryptodev_asymmetric_xfrm_capability * s/xfrm/xform/. Same for the rest of the code. ... > +int __rte_experimental > +rte_cryptodev_asym_xfrm_capability_check_modlen( > + const struct rte_cryptodev_asymmetric_xfrm_capability *capability, > + uint16_t modlen) > +{ > + /* handle special case of 0 which means PMD doesn't define > + * any limit > + */ > + if ((capability->modlen.min !=3D 0) && > + ((modlen < capability->modlen.min) || > + (capability->modlen.increment !=3D 0 && > + (modlen % (capability->modlen.increment))))) > + return -1; It is a bit difficult to read this. I think it would be better to separate = this if into multiple ones, making it easier to review. Same with the following one. > + if ((capability->modlen.max !=3D 0) && > + ((modlen > capability->modlen.max) || > + (capability->modlen.increment !=3D 0 && > + (modlen % (capability->modlen.increment))))) > + return -1; > + > + return 0; > +} > + >=20 > const char * > rte_cryptodev_get_feature_name(uint64_t flag) diff --git > a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptod= ev.h > index 623459a95..6c13d23f8 100644 > --- a/lib/librte_cryptodev/rte_cryptodev.h > +++ b/lib/librte_cryptodev/rte_cryptodev.h ... > @@ -1164,7 +1265,7 @@ int __rte_experimental > rte_cryptodev_asym_session_set_private_data( > struct rte_cryptodev_asym_session > *sess, > void *data, > - uint16_t size) > + uint16_t size); Fix this in previous patch. >=20 > /** > * Get private data of a session. > @@ -1178,7 +1279,7 @@ rte_cryptodev_asym_session_set_private_data( > */ > void * __rte_experimental > rte_cryptodev_asym_session_get_private_data( > - struct rte_cryptodev_asym_session *sess) > + struct rte_cryptodev_asym_session *sess); >=20 >=20 > #ifdef __cplusplus > diff --git a/lib/librte_cryptodev/rte_cryptodev_version.map > b/lib/librte_cryptodev/rte_cryptodev_version.map > index 62b782444..817cf9f70 100644 > --- a/lib/librte_cryptodev/rte_cryptodev_version.map > +++ b/lib/librte_cryptodev/rte_cryptodev_version.map > @@ -89,13 +89,18 @@ DPDK_17.11 { > EXPERIMENTAL { > global: >=20 > - rte_cryptodev_asym_get_private_session_size > + rte_cryptodev_asym_capability_get; > + rte_cryptodev_asym_get_private_session_size; > + rte_cryptodev_asym_get_xform_enum; > + rte_crypto_asym_op_strings; > 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 > + rte_cryptodev_asym_session_get_private_data; > + rte_cryptodev_asym_session_set_private_data; > + rte_cryptodev_asym_xfrm_capability_check_optype; > + rte_crypto_asym_xform_strings; Make sure that list is sorted alphabetically (rte_crypto_* should go at the= end). > rte_cryptodev_sym_session_get_private_data; > rte_cryptodev_sym_session_set_private_data; > } DPDK_17.11; > -- > 2.14.3