From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id D2A2C7CEB for ; Thu, 28 Jun 2018 16:15:47 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jun 2018 07:15:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,283,1526367600"; d="scan'208";a="52962236" Received: from irsmsx153.ger.corp.intel.com ([163.33.192.75]) by orsmga008.jf.intel.com with ESMTP; 28 Jun 2018 07:15:43 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.139]) by IRSMSX153.ger.corp.intel.com ([169.254.9.60]) with mapi id 14.03.0319.002; Thu, 28 Jun 2018 15:15:42 +0100 From: "De Lara Guarch, Pablo" To: "Verma, Shally" , "Doherty, Declan" , "akhil.goyal@nxp.com" , "ravi1.kumar@amd.com" , "Jacob, Jerin" , "Zhang, Roy Fan" , "Trahe, Fiona" , "tdu@semihalf.com" , "jianjay.zhou@huawei.com" CC: "dev@dpdk.org" Thread-Topic: [PATCH v3 16/16] cryptodev: check if symmetric sessions are supported Thread-Index: AQHUDr5ms6q5ex9aXE6OjND7FTexj6R1nOYAgAAaUgA= Date: Thu, 28 Jun 2018 14:15:42 +0000 Message-ID: References: <20180608220234.10170-1-pablo.de.lara.guarch@intel.com> <20180628005304.26544-1-pablo.de.lara.guarch@intel.com> <20180628005304.26544-17-pablo.de.lara.guarch@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMWI1ZGIyOWItOWUyMC00MmNmLTkxY2EtN2EyMDZkM2M2NTFiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRHVxWlpZUjFGa2NTYWtic1FCWm92a3VkRHJWMHlVRUtMdmkrcXZpcDV2OUxmZXFPNmZJOVQwazZiOUsrV21UWCJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3 16/16] cryptodev: check if symmetric sessions are supported 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, 28 Jun 2018 14:15:48 -0000 Hi Shally, > -----Original Message----- > From: Verma, Shally [mailto:Shally.Verma@cavium.com] > Sent: Thursday, June 28, 2018 2:40 PM > To: De Lara Guarch, Pablo ; Doherty, Decl= an > ; akhil.goyal@nxp.com; ravi1.kumar@amd.com; > Jacob, Jerin ; Zhang, Roy Fan > ; Trahe, Fiona ; > tdu@semihalf.com; jianjay.zhou@huawei.com > Cc: dev@dpdk.org > Subject: RE: [PATCH v3 16/16] cryptodev: check if symmetric sessions are > supported >=20 >=20 >=20 > >-----Original Message----- > >From: Pablo de Lara [mailto:pablo.de.lara.guarch@intel.com] > >Sent: 28 June 2018 06:23 > >To: declan.doherty@intel.com; akhil.goyal@nxp.com; Verma, Shally > >; ravi1.kumar@amd.com; Jacob, Jerin > >; roy.fan.zhang@intel.com; > >fiona.trahe@intel.com; tdu@semihalf.com; jianjay.zhou@huawei.com > >Cc: dev@dpdk.org; Pablo de Lara > >Subject: [PATCH v3 16/16] cryptodev: check if symmetric sessions are > >supported > > > >External Email > > > >Since asymmetric functionality will be implemented soon, not all PMDs > >must support symmetric sessions. > >Therefore, a check is added if a device does not implement the > >symmetric functions, meaning that the device does not support symmetric > >operations. > > > >Signed-off-by: Pablo de Lara > >--- > > lib/librte_cryptodev/rte_cryptodev.c | 4 ++++ > >lib/librte_cryptodev/rte_cryptodev.h | 4 +++- > > 2 files changed, 7 insertions(+), 1 deletion(-) > > > >diff --git a/lib/librte_cryptodev/rte_cryptodev.c > >b/lib/librte_cryptodev/rte_cryptodev.c > >index 7af527075..58fb21056 100644 > >--- a/lib/librte_cryptodev/rte_cryptodev.c > >+++ b/lib/librte_cryptodev/rte_cryptodev.c > >@@ -1063,6 +1063,8 @@ rte_cryptodev_sym_session_init(uint8_t dev_id, > > > > index =3D dev->driver_id; > > > >+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->sym_session_configure, > >+ -ENOTSUP); > >+ > > if (sess->sess_private_data[index] =3D=3D NULL) { > > ret =3D dev->dev_ops->sym_session_configure(dev, xforms, > > sess, mp); @@ > >-1107,6 +1109,8 @@ rte_cryptodev_sym_session_clear(uint8_t dev_id, > > if (dev =3D=3D NULL || sess =3D=3D NULL) > > return -EINVAL; > > > >+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->sym_session_clear, > >+ -ENOTSUP); > >+ > > dev->dev_ops->sym_session_clear(dev, sess); > > > > return 0; > >diff --git a/lib/librte_cryptodev/rte_cryptodev.h > >b/lib/librte_cryptodev/rte_cryptodev.h > >index 32a210b00..c1066d01e 100644 > >--- a/lib/librte_cryptodev/rte_cryptodev.h > >+++ b/lib/librte_cryptodev/rte_cryptodev.h > >@@ -896,7 +896,8 @@ rte_cryptodev_sym_session_free(struct > >rte_cryptodev_sym_session *sess); > > * @return > > * - On success, zero. > > * - -EINVAL if input parameters are invalid. > >- * - -ENOTSUP if crypto device does not support the crypto transform. > >+ * - -ENOTSUP if crypto device does not support the crypto transform o= r > >+ * does not support symmetric operations. >=20 > Acked with just one comment here Isn't it sufficient to say if device doe= s not > support symmetric? No, because the device could not support a specific algorithm or other para= meters, such as key size, IV size, etc.