DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [RFC] mark asym session-buffer non-reuseable
@ 2019-07-17 12:34 Ayuj Verma
  2019-07-17 12:34 ` [dpdk-dev] [RFC] lib/crypto: " Ayuj Verma
  2019-07-17 14:10 ` [dpdk-dev] [RFC] " Kusztal, ArkadiuszX
  0 siblings, 2 replies; 10+ messages in thread
From: Ayuj Verma @ 2019-07-17 12:34 UTC (permalink / raw)
  To: akhil.goyal
  Cc: arkadiuszx.kusztal, fiona.trahe, shallyv, ssahu, kkotamarthy,
	dev, Ayuj Verma

This RFC proposes changes in asymmetric session usability of
transform structure. In current implementation asym xform is
seen as temporary entity that can be re-used by application
once sessions are initialized with it.

This enforces PMD to copy all key buffers during session setup
time. Since life-time of sessions are small, so we can hold
these buffers with session, reducing memcpy time by marking these as
read-only so that PMDs which doesn’t require any manipulation of
xform data can directly use these buffers in session configure. 

So, sending a proposal to mark xform as non-reusable till lifetime
of session. This will help PMDs to reduce session setup time.

Ayuj Verma (1):
  lib/crypto: mark asym session-buffer non-reuseable

 doc/guides/prog_guide/cryptodev_lib.rst  | 6 ++++++
 lib/librte_cryptodev/rte_cryptodev_pmd.h | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [dpdk-dev] [RFC] lib/crypto: mark asym session-buffer non-reuseable
  2019-07-17 12:34 [dpdk-dev] [RFC] mark asym session-buffer non-reuseable Ayuj Verma
@ 2019-07-17 12:34 ` Ayuj Verma
  2019-07-17 14:03   ` Trahe, Fiona
  2019-07-17 14:10 ` [dpdk-dev] [RFC] " Kusztal, ArkadiuszX
  1 sibling, 1 reply; 10+ messages in thread
From: Ayuj Verma @ 2019-07-17 12:34 UTC (permalink / raw)
  To: akhil.goyal
  Cc: arkadiuszx.kusztal, fiona.trahe, shallyv, ssahu, kkotamarthy,
	dev, Ayuj Verma

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
+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.
+
 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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [RFC] lib/crypto: mark asym session-buffer non-reuseable
  2019-07-17 12:34 ` [dpdk-dev] [RFC] lib/crypto: " Ayuj Verma
@ 2019-07-17 14:03   ` Trahe, Fiona
  2019-07-17 14:10     ` Kusztal, ArkadiuszX
  0 siblings, 1 reply; 10+ messages in thread
From: Trahe, Fiona @ 2019-07-17 14:03 UTC (permalink / raw)
  To: Ayuj Verma, akhil.goyal
  Cc: Kusztal, ArkadiuszX, shallyv, ssahu, kkotamarthy, dev, Trahe, Fiona

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [RFC] mark asym session-buffer non-reuseable
  2019-07-17 12:34 [dpdk-dev] [RFC] mark asym session-buffer non-reuseable Ayuj Verma
  2019-07-17 12:34 ` [dpdk-dev] [RFC] lib/crypto: " Ayuj Verma
@ 2019-07-17 14:10 ` Kusztal, ArkadiuszX
  2019-07-18  9:47   ` Ayuj Verma
  1 sibling, 1 reply; 10+ messages in thread
From: Kusztal, ArkadiuszX @ 2019-07-17 14:10 UTC (permalink / raw)
  To: Ayuj Verma, akhil.goyal; +Cc: Trahe, Fiona, shallyv, ssahu, kkotamarthy, dev

Hi Ayuj,

> -----Original Message-----
> From: Ayuj Verma [mailto:ayverma@marvell.com]
> Sent: Wednesday, July 17, 2019 2: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] mark asym session-buffer non-reuseable
> 
> This RFC proposes changes in asymmetric session usability of transform
> structure. In current implementation asym xform is seen as temporary entity
> that can be re-used by application once sessions are initialized with it.
> 
> This enforces PMD to copy all key buffers during session setup time. Since
> life-time of sessions are small, so we can hold these buffers with session,
[AK] - what is you expected session lifetime? (2,3,50 packets?)
> reducing memcpy time by marking these as read-only so that PMDs which
> doesn’t require any manipulation of xform data can directly use these
> buffers in session configure.
> 
> So, sending a proposal to mark xform as non-reusable till lifetime of session.
> This will help PMDs to reduce session setup time.
> 
> Ayuj Verma (1):
>   lib/crypto: mark asym session-buffer non-reuseable
> 
>  doc/guides/prog_guide/cryptodev_lib.rst  | 6 ++++++
> lib/librte_cryptodev/rte_cryptodev_pmd.h | 2 +-
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> --
> 1.8.3.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [RFC] lib/crypto: mark asym session-buffer non-reuseable
  2019-07-17 14:03   ` Trahe, Fiona
@ 2019-07-17 14:10     ` Kusztal, ArkadiuszX
  2019-07-18  9:56       ` Ayuj Verma
  0 siblings, 1 reply; 10+ messages in thread
From: Kusztal, ArkadiuszX @ 2019-07-17 14:10 UTC (permalink / raw)
  To: Trahe, Fiona, Ayuj Verma, akhil.goyal; +Cc: shallyv, ssahu, kkotamarthy, dev



> -----Original Message-----
> From: Trahe, Fiona
> Sent: Wednesday, July 17, 2019 4:04 PM
> To: Ayuj Verma <ayverma@marvell.com>; akhil.goyal@nxp.com
> Cc: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>;
> shallyv@marvell.com; ssahu@marvell.com; kkotamarthy@marvell.com;
> dev@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>
> Subject: RE: [RFC] lib/crypto: mark asym session-buffer non-reuseable
> 
> 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..."
[AK] I agree with RFC and Fiona :).
> 
> > +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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [RFC] mark asym session-buffer non-reuseable
  2019-07-17 14:10 ` [dpdk-dev] [RFC] " Kusztal, ArkadiuszX
@ 2019-07-18  9:47   ` Ayuj Verma
  2019-07-19 14:50     ` Ayuj Verma
  0 siblings, 1 reply; 10+ messages in thread
From: Ayuj Verma @ 2019-07-18  9:47 UTC (permalink / raw)
  To: Kusztal, ArkadiuszX, akhil.goyal
  Cc: Trahe, Fiona, Shally Verma, Sunila Sahu, Kanaka Durga Kotamarthy, dev

Hi Arek,


Please see inline.


Thanks and regards

Ayuj Verma


________________________________
From: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>
Sent: 17 July 2019 19:40
To: Ayuj Verma; akhil.goyal@nxp.com
Cc: Trahe, Fiona; Shally Verma; Sunila Sahu; Kanaka Durga Kotamarthy; dev@dpdk.org
Subject: RE: [RFC] mark asym session-buffer non-reuseable

Hi Ayuj,

> -----Original Message-----
> From: Ayuj Verma [mailto:ayverma@marvell.com]
> Sent: Wednesday, July 17, 2019 2: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] mark asym session-buffer non-reuseable
>
> This RFC proposes changes in asymmetric session usability of transform
> structure. In current implementation asym xform is seen as temporary entity
> that can be re-used by application once sessions are initialized with it.
>
> This enforces PMD to copy all key buffers during session setup time. Since
> life-time of sessions are small, so we can hold these buffers with session,
[AK] - what is you expected session lifetime? (2,3,50 packets?)
[Ayuj] In practical scenario like SSL, handshake will happen in some 10-15 packets.
> reducing memcpy time by marking these as read-only so that PMDs which
> doesn’t require any manipulation of xform data can directly use these
> buffers in session configure.
>
> So, sending a proposal to mark xform as non-reusable till lifetime of session.
> This will help PMDs to reduce session setup time.
>
> Ayuj Verma (1):
>   lib/crypto: mark asym session-buffer non-reuseable
>
>  doc/guides/prog_guide/cryptodev_lib.rst  | 6 ++++++
> lib/librte_cryptodev/rte_cryptodev_pmd.h | 2 +-
>  2 files changed, 7 insertions(+), 1 deletion(-)
>
> --
> 1.8.3.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [RFC] lib/crypto: mark asym session-buffer non-reuseable
  2019-07-17 14:10     ` Kusztal, ArkadiuszX
@ 2019-07-18  9:56       ` Ayuj Verma
  2019-07-18 10:49         ` Ayuj Verma
  0 siblings, 1 reply; 10+ messages in thread
From: Ayuj Verma @ 2019-07-18  9:56 UTC (permalink / raw)
  To: Kusztal, ArkadiuszX, Trahe, Fiona, akhil.goyal
  Cc: Shally Verma, Sunila Sahu, Kanaka Durga Kotamarthy, dev

Hi Arek, Fiona


Please see in-line.


Thanks and regards

Ayuj Verma


________________________________
From: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>
Sent: 17 July 2019 19:40
To: Trahe, Fiona; Ayuj Verma; akhil.goyal@nxp.com
Cc: Shally Verma; Sunila Sahu; Kanaka Durga Kotamarthy; dev@dpdk.org
Subject: RE: [RFC] lib/crypto: mark asym session-buffer non-reuseable



> -----Original Message-----
> From: Trahe, Fiona
> Sent: Wednesday, July 17, 2019 4:04 PM
> To: Ayuj Verma <ayverma@marvell.com>; akhil.goyal@nxp.com
> Cc: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>;
> shallyv@marvell.com; ssahu@marvell.com; kkotamarthy@marvell.com;
> dev@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>
> Subject: RE: [RFC] lib/crypto: mark asym session-buffer non-reuseable
>
> 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..."
[AK] I agree with RFC and Fiona :).
[Ayuj] ACK. will submit a v2.
>
> > +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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [RFC] lib/crypto: mark asym session-buffer non-reuseable
  2019-07-18  9:56       ` Ayuj Verma
@ 2019-07-18 10:49         ` Ayuj Verma
  0 siblings, 0 replies; 10+ messages in thread
From: Ayuj Verma @ 2019-07-18 10:49 UTC (permalink / raw)
  To: Kusztal, ArkadiuszX, Trahe, Fiona, akhil.goyal
  Cc: Shally Verma, Sunila Sahu, Kanaka Durga Kotamarthy, dev

Hi Arek, Fiona,



> [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..."
[AK] I agree with RFC and Fiona :).
[Ayuj] ACK. will submit a v2.
>> Correction: Will incorporate this in Patch v1.

Thanks and regards
Ayuj Verma

________________________________
From: Ayuj Verma
Sent: 18 July 2019 15:26
To: Kusztal, ArkadiuszX; Trahe, Fiona; akhil.goyal@nxp.com
Cc: Shally Verma; Sunila Sahu; Kanaka Durga Kotamarthy; dev@dpdk.org
Subject: Re: [RFC] lib/crypto: mark asym session-buffer non-reuseable


Hi Arek, Fiona


Please see in-line.


Thanks and regards

Ayuj Verma


________________________________
From: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>
Sent: 17 July 2019 19:40
To: Trahe, Fiona; Ayuj Verma; akhil.goyal@nxp.com
Cc: Shally Verma; Sunila Sahu; Kanaka Durga Kotamarthy; dev@dpdk.org
Subject: RE: [RFC] lib/crypto: mark asym session-buffer non-reuseable



> -----Original Message-----
> From: Trahe, Fiona
> Sent: Wednesday, July 17, 2019 4:04 PM
> To: Ayuj Verma <ayverma@marvell.com>; akhil.goyal@nxp.com
> Cc: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>;
> shallyv@marvell.com; ssahu@marvell.com; kkotamarthy@marvell.com;
> dev@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>
> Subject: RE: [RFC] lib/crypto: mark asym session-buffer non-reuseable
>
> 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..."
[AK] I agree with RFC and Fiona :).
[Ayuj] ACK. will submit a v2.
>
> > +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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [RFC] mark asym session-buffer non-reuseable
  2019-07-18  9:47   ` Ayuj Verma
@ 2019-07-19 14:50     ` Ayuj Verma
  2019-07-19 15:38       ` Trahe, Fiona
  0 siblings, 1 reply; 10+ messages in thread
From: Ayuj Verma @ 2019-07-19 14:50 UTC (permalink / raw)
  To: Kusztal, ArkadiuszX, akhil.goyal
  Cc: Trahe, Fiona, Shally Verma, Sunila Sahu, Kanaka Durga Kotamarthy, dev

Hi Akhil, Arek, Fiona,


Since this require changes in other Asym PMD( qat) apart from openssl (we plan to send changes for this),

so should we need to send any announcement on ABI breakage here before proposing patch v1?


Thanks and regards

Ayuj Verma

________________________________
From: Ayuj Verma
Sent: 18 July 2019 15:17:54
To: Kusztal, ArkadiuszX; akhil.goyal@nxp.com
Cc: Trahe, Fiona; Shally Verma; Sunila Sahu; Kanaka Durga Kotamarthy; dev@dpdk.org
Subject: Re: [RFC] mark asym session-buffer non-reuseable


Hi Arek,


Please see inline.


Thanks and regards

Ayuj Verma


________________________________
From: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>
Sent: 17 July 2019 19:40
To: Ayuj Verma; akhil.goyal@nxp.com
Cc: Trahe, Fiona; Shally Verma; Sunila Sahu; Kanaka Durga Kotamarthy; dev@dpdk.org
Subject: RE: [RFC] mark asym session-buffer non-reuseable

Hi Ayuj,

> -----Original Message-----
> From: Ayuj Verma [mailto:ayverma@marvell.com]
> Sent: Wednesday, July 17, 2019 2: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] mark asym session-buffer non-reuseable
>
> This RFC proposes changes in asymmetric session usability of transform
> structure. In current implementation asym xform is seen as temporary entity
> that can be re-used by application once sessions are initialized with it.
>
> This enforces PMD to copy all key buffers during session setup time. Since
> life-time of sessions are small, so we can hold these buffers with session,
[AK] - what is you expected session lifetime? (2,3,50 packets?)
[Ayuj] In practical scenario like SSL, handshake will happen in some 10-15 packets.
> reducing memcpy time by marking these as read-only so that PMDs which
> doesn’t require any manipulation of xform data can directly use these
> buffers in session configure.
>
> So, sending a proposal to mark xform as non-reusable till lifetime of session.
> This will help PMDs to reduce session setup time.
>
> Ayuj Verma (1):
>   lib/crypto: mark asym session-buffer non-reuseable
>
>  doc/guides/prog_guide/cryptodev_lib.rst  | 6 ++++++
> lib/librte_cryptodev/rte_cryptodev_pmd.h | 2 +-
>  2 files changed, 7 insertions(+), 1 deletion(-)
>
> --
> 1.8.3.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [RFC] mark asym session-buffer non-reuseable
  2019-07-19 14:50     ` Ayuj Verma
@ 2019-07-19 15:38       ` Trahe, Fiona
  0 siblings, 0 replies; 10+ messages in thread
From: Trahe, Fiona @ 2019-07-19 15:38 UTC (permalink / raw)
  To: Ayuj Verma, Kusztal, ArkadiuszX, akhil.goyal
  Cc: Shally Verma, Sunila Sahu, Kanaka Durga Kotamarthy, dev, Trahe, Fiona

No need as API is still experimental.

Howver I'd suggest changing the subject to
"declare crypto asym xform immutable"
non-reusable is confusing as the session and xform will be re-used on all the ops associated with the session.

From: Ayuj Verma [mailto:ayverma@marvell.com]
Sent: Friday, July 19, 2019 3:51 PM
To: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>; akhil.goyal@nxp.com
Cc: Trahe, Fiona <fiona.trahe@intel.com>; Shally Verma <shallyv@marvell.com>; Sunila Sahu <ssahu@marvell.com>; Kanaka Durga Kotamarthy <kkotamarthy@marvell.com>; dev@dpdk.org
Subject: Re: [RFC] mark asym session-buffer non-reuseable


Hi Akhil, Arek, Fiona,



Since this require changes in other Asym PMD( qat) apart from openssl (we plan to send changes for this),

so should we need to send any announcement on ABI breakage here before proposing patch v1?



Thanks and regards

Ayuj Verma

________________________________
From: Ayuj Verma
Sent: 18 July 2019 15:17:54
To: Kusztal, ArkadiuszX; akhil.goyal@nxp.com<mailto:akhil.goyal@nxp.com>
Cc: Trahe, Fiona; Shally Verma; Sunila Sahu; Kanaka Durga Kotamarthy; dev@dpdk.org<mailto:dev@dpdk.org>
Subject: Re: [RFC] mark asym session-buffer non-reuseable


Hi Arek,



Please see inline.



Thanks and regards

Ayuj Verma

________________________________
From: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com<mailto:arkadiuszx.kusztal@intel.com>>
Sent: 17 July 2019 19:40
To: Ayuj Verma; akhil.goyal@nxp.com<mailto:akhil.goyal@nxp.com>
Cc: Trahe, Fiona; Shally Verma; Sunila Sahu; Kanaka Durga Kotamarthy; dev@dpdk.org<mailto:dev@dpdk.org>
Subject: RE: [RFC] mark asym session-buffer non-reuseable

Hi Ayuj,

> -----Original Message-----
> From: Ayuj Verma [mailto:ayverma@marvell.com]
> Sent: Wednesday, July 17, 2019 2:34 PM
> To: akhil.goyal@nxp.com<mailto:akhil.goyal@nxp.com>
> Cc: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com<mailto:arkadiuszx.kusztal@intel.com>>; Trahe, Fiona
> <fiona.trahe@intel.com<mailto:fiona.trahe@intel.com>>; shallyv@marvell.com<mailto:shallyv@marvell.com>; ssahu@marvell.com<mailto:ssahu@marvell.com>;
> kkotamarthy@marvell.com<mailto:kkotamarthy@marvell.com>; dev@dpdk.org<mailto:dev@dpdk.org>; Ayuj Verma
> <ayverma@marvell.com<mailto:ayverma@marvell.com>>
> Subject: [RFC] mark asym session-buffer non-reuseable
>
> This RFC proposes changes in asymmetric session usability of transform
> structure. In current implementation asym xform is seen as temporary entity
> that can be re-used by application once sessions are initialized with it.
>
> This enforces PMD to copy all key buffers during session setup time. Since
> life-time of sessions are small, so we can hold these buffers with session,
[AK] - what is you expected session lifetime? (2,3,50 packets?)
[Ayuj] In practical scenario like SSL, handshake will happen in some 10-15 packets.
> reducing memcpy time by marking these as read-only so that PMDs which
> doesn't require any manipulation of xform data can directly use these
> buffers in session configure.
>
> So, sending a proposal to mark xform as non-reusable till lifetime of session.
> This will help PMDs to reduce session setup time.
>
> Ayuj Verma (1):
>   lib/crypto: mark asym session-buffer non-reuseable
>
>  doc/guides/prog_guide/cryptodev_lib.rst  | 6 ++++++
> lib/librte_cryptodev/rte_cryptodev_pmd.h | 2 +-
>  2 files changed, 7 insertions(+), 1 deletion(-)
>
> --
> 1.8.3.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-07-19 15:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-17 12:34 [dpdk-dev] [RFC] mark asym session-buffer non-reuseable Ayuj Verma
2019-07-17 12:34 ` [dpdk-dev] [RFC] lib/crypto: " Ayuj Verma
2019-07-17 14:03   ` Trahe, Fiona
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).