DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
From: "Trahe, Fiona" <fiona.trahe@intel.com>
To: Ayuj Verma <ayverma@marvell.com>,
	"akhil.goyal@nxp.com" <akhil.goyal@nxp.com>
Cc: "Kusztal, ArkadiuszX" <arkadiuszx.kusztal@intel.com>,
	"shallyv@marvell.com" <shallyv@marvell.com>,
	"ssahu@marvell.com" <ssahu@marvell.com>,
	"kkotamarthy@marvell.com" <kkotamarthy@marvell.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"Trahe, Fiona" <fiona.trahe@intel.com>
Subject: Re: [dpdk-dev] [RFC] lib/crypto: mark asym session-buffer non-reuseable
Date: Wed, 17 Jul 2019 14:03:36 +0000
Message-ID: <348A99DA5F5B7549AA880327E580B435897C6583@IRSMSX101.ger.corp.intel.com> (raw)
In-Reply-To: <1563366852-23118-2-git-send-email-ayverma@marvell.com>

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 <arkadiuszx.kusztal@intel.com>; Trahe, Fiona <fiona.trahe@intel.com>;
> shallyv@marvell.com; ssahu@marvell.com; kkotamarthy@marvell.com; dev@dpdk.org; Ayuj Verma
> <ayverma@marvell.com>
> 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 <ayverma@marvell.com>
> Signed-off-by: Shally Verma <shallyv@marvell.com>
> ---
>  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 explicit and 
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 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.

>  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_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


  reply index

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-17 12:34 [dpdk-dev] [RFC] " Ayuj Verma
2019-07-17 12:34 ` [dpdk-dev] [RFC] lib/crypto: " Ayuj Verma
2019-07-17 14:03   ` Trahe, Fiona [this message]
2019-07-17 14:10     ` Kusztal, ArkadiuszX
2019-07-18  9:56       ` Ayuj Verma
2019-07-18 10:49         ` Ayuj Verma
2019-07-17 14:10 ` [dpdk-dev] [RFC] " Kusztal, ArkadiuszX
2019-07-18  9:47   ` Ayuj Verma
2019-07-19 14:50     ` Ayuj Verma
2019-07-19 15:38       ` Trahe, Fiona

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=348A99DA5F5B7549AA880327E580B435897C6583@IRSMSX101.ger.corp.intel.com \
    --to=fiona.trahe@intel.com \
    --cc=akhil.goyal@nxp.com \
    --cc=arkadiuszx.kusztal@intel.com \
    --cc=ayverma@marvell.com \
    --cc=dev@dpdk.org \
    --cc=kkotamarthy@marvell.com \
    --cc=shallyv@marvell.com \
    --cc=ssahu@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK-dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dpdk-dev/0 dpdk-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dpdk-dev dpdk-dev/ https://lore.kernel.org/dpdk-dev \
		dev@dpdk.org dpdk-dev@archiver.kernel.org
	public-inbox-index dpdk-dev


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox