From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9245AC76195 for ; Wed, 17 Jul 2019 14:10:56 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 3090221743 for ; Wed, 17 Jul 2019 14:10:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3090221743 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4F14C1B9A7; Wed, 17 Jul 2019 16:10:55 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 844272BBE for ; Wed, 17 Jul 2019 16:10:53 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2019 07:10:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,274,1559545200"; d="scan'208";a="366575495" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga005.fm.intel.com with ESMTP; 17 Jul 2019 07:10:52 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 17 Jul 2019 07:10:52 -0700 Received: from lcsmsx152.ger.corp.intel.com (10.186.165.231) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 17 Jul 2019 07:10:52 -0700 Received: from HASMSX109.ger.corp.intel.com ([169.254.3.134]) by LCSMSX152.ger.corp.intel.com ([169.254.4.180]) with mapi id 14.03.0439.000; Wed, 17 Jul 2019 17:10:49 +0300 From: "Kusztal, ArkadiuszX" To: "Trahe, Fiona" , Ayuj Verma , "akhil.goyal@nxp.com" CC: "shallyv@marvell.com" , "ssahu@marvell.com" , "kkotamarthy@marvell.com" , "dev@dpdk.org" Thread-Topic: [RFC] lib/crypto: mark asym session-buffer non-reuseable Thread-Index: AQHVPJv8XNhs7C+Nt0+uIU0YlH3cb6bOpVcAgAA0I4A= Date: Wed, 17 Jul 2019 14:10:49 +0000 Message-ID: <06EE24DD0B19E248B53F6DC8657831551B280B26@hasmsx109.ger.corp.intel.com> References: <1563366852-23118-1-git-send-email-ayverma@marvell.com> <1563366852-23118-2-git-send-email-ayverma@marvell.com> <348A99DA5F5B7549AA880327E580B435897C6583@IRSMSX101.ger.corp.intel.com> In-Reply-To: <348A99DA5F5B7549AA880327E580B435897C6583@IRSMSX101.ger.corp.intel.com> Accept-Language: pl-PL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.184.70.11] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [RFC] lib/crypto: mark asym session-buffer non-reuseable 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Trahe, Fiona > Sent: Wednesday, July 17, 2019 4:04 PM > To: Ayuj Verma ; akhil.goyal@nxp.com > Cc: Kusztal, ArkadiuszX ; > shallyv@marvell.com; ssahu@marvell.com; kkotamarthy@marvell.com; > dev@dpdk.org; Trahe, Fiona > Subject: RE: [RFC] lib/crypto: mark asym session-buffer non-reuseable >=20 > Hi Ayuj, >=20 > > -----Original Message----- > > From: Ayuj Verma [mailto:ayverma@marvell.com] > > Sent: Wednesday, July 17, 2019 1:34 PM > > To: akhil.goyal@nxp.com > > Cc: Kusztal, ArkadiuszX ; Trahe, Fiona > > ; shallyv@marvell.com; ssahu@marvell.com; > > kkotamarthy@marvell.com; dev@dpdk.org; Ayuj Verma > > > > Subject: [RFC] lib/crypto: mark asym session-buffer non-reuseable > > > > Update asym xform usage in cryptodev documentation. > > > > Xform are immutable, non-reuseable entity till life time of session. > > This allow some PMD to optimize session setup time. > > > > Signed-off-by: Ayuj Verma > > Signed-off-by: Shally Verma > > --- > > doc/guides/prog_guide/cryptodev_lib.rst | 6 ++++++ > > lib/librte_cryptodev/rte_cryptodev_pmd.h | 2 +- > > 2 files changed, 7 insertions(+), 1 deletion(-) > > > > diff --git a/doc/guides/prog_guide/cryptodev_lib.rst > > b/doc/guides/prog_guide/cryptodev_lib.rst > > index 9719944..c97a239 100644 > > --- a/doc/guides/prog_guide/cryptodev_lib.rst > > +++ b/doc/guides/prog_guide/cryptodev_lib.rst > > @@ -894,6 +894,12 @@ asymmetric crypto chaining is Diffie-Hellman > > private key generation followed by public generation. Also, currently > > API does not support chaining of symmetric and asymmetric crypto > > xforms. > > > > +Transform is attached to session during asym session initialization > > +and can't be modified during session configuration. It remains > > +constant till the end of life > [Fiona] I agree with the intent of the RFC. And suggest being more explic= it > and saying "It and all the data buffers it points to should remain consta= nt..." [AK] I agree with RFC and Fiona :). >=20 > > +span of a session. It should be used as it is in PMD, PMDs which > > +requires modification of these immutable data should internally do > > +memcpy of data and perform required operations. > [Fiona] for security I suggest adding here "It's the PMDs responsibility = to > ensure that any private data copied to local PMD storage is not stored by= the > PMD for longer than the session lifetime. >=20 > > Each xform defines specific asymmetric crypto algo. Currently supporte= d > are: > > * RSA > > * Modular operations (Exponentiation and Inverse) diff --git > > a/lib/librte_cryptodev/rte_cryptodev_pmd.h > > b/lib/librte_cryptodev/rte_cryptodev_pmd.h > > index defe05e..1f083ea 100644 > > --- a/lib/librte_cryptodev/rte_cryptodev_pmd.h > > +++ b/lib/librte_cryptodev/rte_cryptodev_pmd.h > > @@ -290,7 +290,7 @@ typedef int > (*cryptodev_sym_configure_session_t)(struct rte_cryptodev *dev, > > * - Returns -ENOMEM if the private session could not be allocated. > > */ > > typedef int (*cryptodev_asym_configure_session_t)(struct rte_cryptodev > *dev, > > - struct rte_crypto_asym_xform *xform, > > + const struct rte_crypto_asym_xform *xform, > > struct rte_cryptodev_asym_session *session, > > struct rte_mempool *mp); > > /** > > -- > > 1.8.3.1