[v5] cryptodev: extend api of asymmetric crypto by session-less

Message ID 20191010110239.10508-1-arkadiuszx.kusztal@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [v5] cryptodev: extend api of asymmetric crypto by session-less |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-compilation success Compile Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Arkadiusz Kusztal Oct. 10, 2019, 11:02 a.m. UTC
  This commit adds asymmetric session-less option to
rte_crypto_asym_op. Feature flag for session-less is added
to rte_cryptodev.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
v2:
- added union
v3:
- added entry into feature matrix
- added information to prog_guide
v4:
- fixed formatting
- fixed grammar
v5:
- added release note

 doc/guides/cryptodevs/features/default.ini | 1 +
 doc/guides/prog_guide/cryptodev_lib.rst    | 9 ++++++++-
 doc/guides/rel_notes/release_19_11.rst     | 5 +++++
 lib/librte_cryptodev/rte_crypto_asym.h     | 9 +++++++--
 lib/librte_cryptodev/rte_cryptodev.h       | 2 ++
 5 files changed, 23 insertions(+), 3 deletions(-)
  

Comments

Anoob Joseph Oct. 14, 2019, 3:39 a.m. UTC | #1
Hi Arek,

Minor suggestion inline. Not a blocker issue.

Acked-by: Anoob Joseph <anoobj@marvell.com>

> -----Original Message-----
> From: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> Sent: Thursday, October 10, 2019 4:33 PM
> To: dev@dpdk.org
> Cc: akhil.goyal@nxp.com; fiona.trahe@intel.com; Anoob Joseph
> <anoobj@marvell.com>; Shally Verma <shallyv@marvell.com>; Arek Kusztal
> <arkadiuszx.kusztal@intel.com>
> Subject: [EXT] [PATCH v5] cryptodev: extend api of asymmetric crypto by
> session-less
> 
> External Email
> 
> ----------------------------------------------------------------------
> This commit adds asymmetric session-less option to rte_crypto_asym_op.
> Feature flag for session-less is added to rte_cryptodev.
> 
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> ---
> v2:
> - added union
> v3:
> - added entry into feature matrix
> - added information to prog_guide
> v4:
> - fixed formatting
> - fixed grammar
> v5:
> - added release note
> 
>  doc/guides/cryptodevs/features/default.ini | 1 +
>  doc/guides/prog_guide/cryptodev_lib.rst    | 9 ++++++++-
>  doc/guides/rel_notes/release_19_11.rst     | 5 +++++
>  lib/librte_cryptodev/rte_crypto_asym.h     | 9 +++++++--
>  lib/librte_cryptodev/rte_cryptodev.h       | 2 ++
>  5 files changed, 23 insertions(+), 3 deletions(-)
> 
> diff --git a/doc/guides/cryptodevs/features/default.ini
> b/doc/guides/cryptodevs/features/default.ini
> index d3ee1af..b7f9a0a 100644
> --- a/doc/guides/cryptodevs/features/default.ini
> +++ b/doc/guides/cryptodevs/features/default.ini
> @@ -26,6 +26,7 @@ OOP LB  In LB  Out     =
>  RSA PRIV OP KEY EXP    =
>  RSA PRIV OP KEY QT     =
>  Digest encrypted       =
> +Asymmetric sessionless =
> 
>  ;
>  ; Supported crypto algorithms of a default crypto driver.
> diff --git a/doc/guides/prog_guide/cryptodev_lib.rst
> b/doc/guides/prog_guide/cryptodev_lib.rst
> index 9719944..d420220 100644
> --- a/doc/guides/prog_guide/cryptodev_lib.rst
> +++ b/doc/guides/prog_guide/cryptodev_lib.rst
> @@ -876,7 +876,14 @@ private asymmetric session data. Once this is done,
> session should be freed usin
> 
>  Asymmetric Sessionless Support
>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> -Currently asymmetric crypto framework does not support sessionless.
> +Asymmetric crypto framework supports session-less operations.
> +
> +Fields that should be set by user are:
> +
> +Member xform of struct rte_crypto_asym_op should point to the user
> created rte_crypto_asym_xform.
> +Note that this rte_crypto_asym_xform should be immutable for the
> lifetime of associated crypto_op.
> +
> +Member sess_type of rte_crypto_op should be set to
> RTE_CRYPTO_OP_SESSIONLESS.
> 
>  Transforms and Transform Chaining
>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> diff --git a/doc/guides/rel_notes/release_19_11.rst
> b/doc/guides/rel_notes/release_19_11.rst
> index 02fc8fb..4ede7e8 100644
> --- a/doc/guides/rel_notes/release_19_11.rst
> +++ b/doc/guides/rel_notes/release_19_11.rst
> @@ -85,6 +85,11 @@ New Features
>    Added stateful decompression support in the Intel QuickAssist Technology
> PMD.
>    Please note that stateful compression is not supported.
> 
> +* **Added cryptodev API to use asymmetric session-less operation.**
> +
> +  Added session-less option to cryptodev asymmetric API. It works the
> + same way  as symmetric crypto does namely xform is used directly by the
> crypto op.
> +

[Anoob] The above line could be confusing. I guess you will need a comma after "crypto does".

It works the same way as symmetric crypto does, namely xform is used directly by the crypto op.

[Even "does" may not be required]
 
> 
>  Removed Items
>  -------------
> diff --git a/lib/librte_cryptodev/rte_crypto_asym.h
> b/lib/librte_cryptodev/rte_crypto_asym.h
> index 4fbef2f..0d34ce8 100644
> --- a/lib/librte_cryptodev/rte_crypto_asym.h
> +++ b/lib/librte_cryptodev/rte_crypto_asym.h
> @@ -522,8 +522,13 @@ struct rte_crypto_dsa_op_param {
>   *
>   */
>  struct rte_crypto_asym_op {
> -	struct rte_cryptodev_asym_session *session;
> -	/**< Handle for the initialised session context */
> +	RTE_STD_C11
> +	union {
> +		struct rte_cryptodev_asym_session *session;
> +		/**< Handle for the initialised session context */
> +		struct rte_crypto_asym_xform *xform;
> +		/**< Session-less API crypto operation parameters */
> +	};
> 
>  	__extension__
>  	union {
> diff --git a/lib/librte_cryptodev/rte_cryptodev.h
> b/lib/librte_cryptodev/rte_cryptodev.h
> index e175b83..c6ffa3b 100644
> --- a/lib/librte_cryptodev/rte_cryptodev.h
> +++ b/lib/librte_cryptodev/rte_cryptodev.h
> @@ -448,6 +448,8 @@ rte_cryptodev_asym_get_xform_enum(enum
> rte_crypto_asym_xform_type *xform_enum,  /**< Support RSA Private Key
> OP with CRT (quintuple) Keys */
>  #define RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED		(1ULL << 19)
>  /**< Support encrypted-digest operations where digest is appended to data
> */
> +#define RTE_CRYPTODEV_FF_ASYM_SESSIONLESS		(1ULL << 20)
> +/**< Support asymmetric session-less operations */
> 
> 
>  /**
> --
> 2.1.0
  
Akhil Goyal Oct. 15, 2019, 10:05 a.m. UTC | #2
Updated Title to "cryptodev: update asymmetric crypto op for session-less"

> 
> Hi Arek,
> 
> Minor suggestion inline. Not a blocker issue.
> 
> Acked-by: Anoob Joseph <anoobj@marvell.com>
> 
> > This commit adds asymmetric session-less option to rte_crypto_asym_op.
> > Feature flag for session-less is added to rte_cryptodev.
> >
> > Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> > ---
> > v2:
> > - added union
> > v3:
> > - added entry into feature matrix
> > - added information to prog_guide
> > v4:
> > - fixed formatting
> > - fixed grammar
> > v5:
> > - added release note
> >
> >  doc/guides/cryptodevs/features/default.ini | 1 +
> >  doc/guides/prog_guide/cryptodev_lib.rst    | 9 ++++++++-
> >  doc/guides/rel_notes/release_19_11.rst     | 5 +++++
> >  lib/librte_cryptodev/rte_crypto_asym.h     | 9 +++++++--
> >  lib/librte_cryptodev/rte_cryptodev.h       | 2 ++
> >  5 files changed, 23 insertions(+), 3 deletions(-)
> >
> > diff --git a/doc/guides/cryptodevs/features/default.ini
> > b/doc/guides/cryptodevs/features/default.ini
> > index d3ee1af..b7f9a0a 100644
> > --- a/doc/guides/cryptodevs/features/default.ini
> > +++ b/doc/guides/cryptodevs/features/default.ini
> > @@ -26,6 +26,7 @@ OOP LB  In LB  Out     =
> >  RSA PRIV OP KEY EXP    =
> >  RSA PRIV OP KEY QT     =
> >  Digest encrypted       =
> > +Asymmetric sessionless =
> >
> >  ;
> >  ; Supported crypto algorithms of a default crypto driver.
> > diff --git a/doc/guides/prog_guide/cryptodev_lib.rst
> > b/doc/guides/prog_guide/cryptodev_lib.rst
> > index 9719944..d420220 100644
> > --- a/doc/guides/prog_guide/cryptodev_lib.rst
> > +++ b/doc/guides/prog_guide/cryptodev_lib.rst
> > @@ -876,7 +876,14 @@ private asymmetric session data. Once this is done,
> > session should be freed usin
> >
> >  Asymmetric Sessionless Support
> >  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > -Currently asymmetric crypto framework does not support sessionless.
> > +Asymmetric crypto framework supports session-less operations.
> > +
> > +Fields that should be set by user are:
> > +
> > +Member xform of struct rte_crypto_asym_op should point to the user
> > created rte_crypto_asym_xform.
> > +Note that this rte_crypto_asym_xform should be immutable for the
> > lifetime of associated crypto_op.
> > +
> > +Member sess_type of rte_crypto_op should be set to
> > RTE_CRYPTO_OP_SESSIONLESS.
> >
> >  Transforms and Transform Chaining
> >  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > diff --git a/doc/guides/rel_notes/release_19_11.rst
> > b/doc/guides/rel_notes/release_19_11.rst
> > index 02fc8fb..4ede7e8 100644
> > --- a/doc/guides/rel_notes/release_19_11.rst
> > +++ b/doc/guides/rel_notes/release_19_11.rst
> > @@ -85,6 +85,11 @@ New Features
> >    Added stateful decompression support in the Intel QuickAssist Technology
> > PMD.
> >    Please note that stateful compression is not supported.
> >
> > +* **Added cryptodev API to use asymmetric session-less operation.**
> > +
> > +  Added session-less option to cryptodev asymmetric API. It works the
> > + same way  as symmetric crypto does namely xform is used directly by the
> > crypto op.
> > +
> 
> [Anoob] The above line could be confusing. I guess you will need a comma after
> "crypto does".
> 
> It works the same way as symmetric crypto does, namely xform is used directly
> by the crypto op.
> 
> [Even "does" may not be required]

Updated release notes as
+* **Added cryptodev asymmetric session-less operation.**
+
+  Added session-less option to cryptodev asymmetric structure. It works the same
+  way as symmetric crypto, corresponding xform is used directly by the crypto op.
+

Acked-by: Akhil Goyal <akhil.goyal@nxp.com>

Applied to dpdk-next-crypto

Thanks
  

Patch

diff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryptodevs/features/default.ini
index d3ee1af..b7f9a0a 100644
--- a/doc/guides/cryptodevs/features/default.ini
+++ b/doc/guides/cryptodevs/features/default.ini
@@ -26,6 +26,7 @@  OOP LB  In LB  Out     =
 RSA PRIV OP KEY EXP    =
 RSA PRIV OP KEY QT     =
 Digest encrypted       =
+Asymmetric sessionless =
 
 ;
 ; Supported crypto algorithms of a default crypto driver.
diff --git a/doc/guides/prog_guide/cryptodev_lib.rst b/doc/guides/prog_guide/cryptodev_lib.rst
index 9719944..d420220 100644
--- a/doc/guides/prog_guide/cryptodev_lib.rst
+++ b/doc/guides/prog_guide/cryptodev_lib.rst
@@ -876,7 +876,14 @@  private asymmetric session data. Once this is done, session should be freed usin
 
 Asymmetric Sessionless Support
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Currently asymmetric crypto framework does not support sessionless.
+Asymmetric crypto framework supports session-less operations.
+
+Fields that should be set by user are:
+
+Member xform of struct rte_crypto_asym_op should point to the user created rte_crypto_asym_xform.
+Note that this rte_crypto_asym_xform should be immutable for the lifetime of associated crypto_op.
+
+Member sess_type of rte_crypto_op should be set to RTE_CRYPTO_OP_SESSIONLESS.
 
 Transforms and Transform Chaining
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 02fc8fb..4ede7e8 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -85,6 +85,11 @@  New Features
   Added stateful decompression support in the Intel QuickAssist Technology PMD.
   Please note that stateful compression is not supported.
 
+* **Added cryptodev API to use asymmetric session-less operation.**
+
+  Added session-less option to cryptodev asymmetric API. It works the same way
+  as symmetric crypto does namely xform is used directly by the crypto op.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_cryptodev/rte_crypto_asym.h b/lib/librte_cryptodev/rte_crypto_asym.h
index 4fbef2f..0d34ce8 100644
--- a/lib/librte_cryptodev/rte_crypto_asym.h
+++ b/lib/librte_cryptodev/rte_crypto_asym.h
@@ -522,8 +522,13 @@  struct rte_crypto_dsa_op_param {
  *
  */
 struct rte_crypto_asym_op {
-	struct rte_cryptodev_asym_session *session;
-	/**< Handle for the initialised session context */
+	RTE_STD_C11
+	union {
+		struct rte_cryptodev_asym_session *session;
+		/**< Handle for the initialised session context */
+		struct rte_crypto_asym_xform *xform;
+		/**< Session-less API crypto operation parameters */
+	};
 
 	__extension__
 	union {
diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h
index e175b83..c6ffa3b 100644
--- a/lib/librte_cryptodev/rte_cryptodev.h
+++ b/lib/librte_cryptodev/rte_cryptodev.h
@@ -448,6 +448,8 @@  rte_cryptodev_asym_get_xform_enum(enum rte_crypto_asym_xform_type *xform_enum,
 /**< Support RSA Private Key OP with CRT (quintuple) Keys */
 #define RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED		(1ULL << 19)
 /**< Support encrypted-digest operations where digest is appended to data */
+#define RTE_CRYPTODEV_FF_ASYM_SESSIONLESS		(1ULL << 20)
+/**< Support asymmetric session-less operations */
 
 
 /**