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.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 413A7C76186 for ; Wed, 17 Jul 2019 14:03:46 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id CFC182173B for ; Wed, 17 Jul 2019 14:03:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CFC182173B 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 B34CE1BDF2; Wed, 17 Jul 2019 16:03:44 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 339FE1BDE9 for ; Wed, 17 Jul 2019 16:03:43 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2019 07:03:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,274,1559545200"; d="scan'208";a="343040411" Received: from irsmsx108.ger.corp.intel.com ([163.33.3.3]) by orsmga005.jf.intel.com with ESMTP; 17 Jul 2019 07:03:40 -0700 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.88]) by IRSMSX108.ger.corp.intel.com ([169.254.11.229]) with mapi id 14.03.0439.000; Wed, 17 Jul 2019 15:03:36 +0100 From: "Trahe, Fiona" To: Ayuj Verma , "akhil.goyal@nxp.com" CC: "Kusztal, ArkadiuszX" , "shallyv@marvell.com" , "ssahu@marvell.com" , "kkotamarthy@marvell.com" , "dev@dpdk.org" , "Trahe, Fiona" Thread-Topic: [RFC] lib/crypto: mark asym session-buffer non-reuseable Thread-Index: AQHVPJv7jkViHYDFq0aoXD+cnDH6VKbO1ZnQ Date: Wed, 17 Jul 2019 14:03:36 +0000 Message-ID: <348A99DA5F5B7549AA880327E580B435897C6583@IRSMSX101.ger.corp.intel.com> References: <1563366852-23118-1-git-send-email-ayverma@marvell.com> <1563366852-23118-2-git-send-email-ayverma@marvell.com> In-Reply-To: <1563366852-23118-2-git-send-email-ayverma@marvell.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZGMyMjRiM2ItY2U3Ny00ZWViLTliZTgtZGMwYmJmYmUyNjU1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibXhWdVwvZThFT1pmTnF0U01vZ3NzUEV0cHllWVB6cGJ4MThDbEdKSUdzQ01CZEZaakFlb2FpcUdxS0J0Uk9YbnoifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [163.33.239.182] 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" Hi Ayuj, > -----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 >=20 > Update asym xform usage in cryptodev documentation. >=20 > Xform are immutable, non-reuseable entity till > life time of session. This allow some PMD to optimize > session setup time. >=20 > 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(-) >=20 > diff --git a/doc/guides/prog_guide/cryptodev_lib.rst b/doc/guides/prog_gu= ide/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 symm= etric and > asymmetric crypto xforms. >=20 > +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 explicit= and=20 saying "It and all the data buffers it points to should remain constant..." > +span of a session. It should be used as it is in PMD, PMDs which require= s > +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 se= ssion lifetime. > Each xform defines specific asymmetric crypto algo. Currently supported = are: > * RSA > * Modular operations (Exponentiation and Inverse) > diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.h b/lib/librte_crypto= dev/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)(stru= ct 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