From b3aaf24de5a910408ee25cb0835bae0d95d60d7f Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 16 Apr 2020 10:25:29 +0100 Subject: [PATCH] cryptodev: add session-less feature flag Add feature flag for symmetric sessionless support, so it can be checked by applications. Signed-off-by: Pablo de Lara Acked-by: Adam Dybkowski Tested-by: Ruifeng Wang Acked-by: Fiona Trahe Acked-by: Akhil Goyal --- doc/guides/cryptodevs/features/aesni_gcm.ini | 1 + doc/guides/cryptodevs/features/aesni_mb.ini | 1 + doc/guides/cryptodevs/features/armv8.ini | 1 + doc/guides/cryptodevs/features/caam_jr.ini | 2 +- doc/guides/cryptodevs/features/ccp.ini | 3 ++- doc/guides/cryptodevs/features/default.ini | 1 + doc/guides/cryptodevs/features/kasumi.ini | 3 ++- doc/guides/cryptodevs/features/octeontx.ini | 1 + doc/guides/cryptodevs/features/octeontx2.ini | 1 + doc/guides/cryptodevs/features/openssl.ini | 1 + doc/guides/cryptodevs/features/snow3g.ini | 3 ++- doc/guides/cryptodevs/features/zuc.ini | 1 + drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 3 ++- drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 3 ++- drivers/crypto/armv8/rte_armv8_pmd.c | 3 ++- drivers/crypto/ccp/rte_ccp_pmd.c | 3 ++- drivers/crypto/kasumi/rte_kasumi_pmd.c | 3 ++- drivers/crypto/null/null_crypto_pmd.c | 3 ++- drivers/crypto/octeontx/otx_cryptodev_ops.c | 3 ++- drivers/crypto/octeontx2/otx2_cryptodev.c | 3 ++- drivers/crypto/openssl/rte_openssl_pmd.c | 3 ++- drivers/crypto/snow3g/rte_snow3g_pmd.c | 3 ++- drivers/crypto/zuc/rte_zuc_pmd.c | 3 ++- lib/librte_cryptodev/rte_cryptodev.c | 2 ++ lib/librte_cryptodev/rte_cryptodev.h | 2 ++ 25 files changed, 41 insertions(+), 15 deletions(-) diff --git a/doc/guides/cryptodevs/features/aesni_gcm.ini b/doc/guides/cryptodevs/features/aesni_gcm.ini index 949d6a088d..c592298668 100644 --- a/doc/guides/cryptodevs/features/aesni_gcm.ini +++ b/doc/guides/cryptodevs/features/aesni_gcm.ini @@ -15,6 +15,7 @@ In Place SGL = Y OOP SGL In LB Out = Y OOP LB In LB Out = Y CPU crypto = Y +Symmetric sessionless = Y ; ; Supported crypto algorithms of the 'aesni_gcm' crypto driver. ; diff --git a/doc/guides/cryptodevs/features/aesni_mb.ini b/doc/guides/cryptodevs/features/aesni_mb.ini index 6cc4c82e85..49cb82a390 100644 --- a/doc/guides/cryptodevs/features/aesni_mb.ini +++ b/doc/guides/cryptodevs/features/aesni_mb.ini @@ -13,6 +13,7 @@ CPU AVX512 = Y CPU AESNI = Y OOP LB In LB Out = Y CPU crypto = Y +Symmetric sessionless = Y ; ; Supported crypto algorithms of the 'aesni_mb' crypto driver. diff --git a/doc/guides/cryptodevs/features/armv8.ini b/doc/guides/cryptodevs/features/armv8.ini index e588f90217..beb40c0578 100644 --- a/doc/guides/cryptodevs/features/armv8.ini +++ b/doc/guides/cryptodevs/features/armv8.ini @@ -8,6 +8,7 @@ Symmetric crypto = Y Sym operation chaining = Y CPU NEON = Y CPU ARM CE = Y +Symmetric sessionless = Y ; ; Supported crypto algorithms of the 'armv8' crypto driver. diff --git a/doc/guides/cryptodevs/features/caam_jr.ini b/doc/guides/cryptodevs/features/caam_jr.ini index c64bd35dae..8d55cdb6cd 100644 --- a/doc/guides/cryptodevs/features/caam_jr.ini +++ b/doc/guides/cryptodevs/features/caam_jr.ini @@ -48,4 +48,4 @@ AES GCM (256) = Y ; ; Supported Asymmetric algorithms of the 'dpaa2_sec' crypto driver. ; -[Asymmetric] \ No newline at end of file +[Asymmetric] diff --git a/doc/guides/cryptodevs/features/ccp.ini b/doc/guides/cryptodevs/features/ccp.ini index 2970076b8f..866d4c52e7 100644 --- a/doc/guides/cryptodevs/features/ccp.ini +++ b/doc/guides/cryptodevs/features/ccp.ini @@ -7,6 +7,7 @@ Symmetric crypto = Y Sym operation chaining = Y HW Accelerated = Y +Symmetric sessionless = Y ; ; Supported crypto algorithms of the 'ccp' crypto driver. @@ -61,4 +62,4 @@ AES GCM (256) = Y ; ; Supported Asymmetric algorithms of the 'ccp' crypto driver. ; -[Asymmetric] \ No newline at end of file +[Asymmetric] diff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryptodevs/features/default.ini index db427af28b..118479db52 100644 --- a/doc/guides/cryptodevs/features/default.ini +++ b/doc/guides/cryptodevs/features/default.ini @@ -28,6 +28,7 @@ RSA PRIV OP KEY QT = Digest encrypted = Asymmetric sessionless = CPU crypto = +Symmetric sessionless = ; ; Supported crypto algorithms of a default crypto driver. diff --git a/doc/guides/cryptodevs/features/kasumi.ini b/doc/guides/cryptodevs/features/kasumi.ini index f3d061009b..99ded0401d 100644 --- a/doc/guides/cryptodevs/features/kasumi.ini +++ b/doc/guides/cryptodevs/features/kasumi.ini @@ -6,6 +6,7 @@ [Features] Symmetric crypto = Y Sym operation chaining = Y +Symmetric sessionless = Y ; ; Supported crypto algorithms of the 'kasumi' crypto driver. @@ -26,4 +27,4 @@ KASUMI F9 = Y ; ; Supported Asymmetric algorithms of the 'kasumi' crypto driver. ; -[Asymmetric] \ No newline at end of file +[Asymmetric] diff --git a/doc/guides/cryptodevs/features/octeontx.ini b/doc/guides/cryptodevs/features/octeontx.ini index f0ed3ed78b..4ce4ff1699 100644 --- a/doc/guides/cryptodevs/features/octeontx.ini +++ b/doc/guides/cryptodevs/features/octeontx.ini @@ -12,6 +12,7 @@ In Place SGL = Y OOP SGL In LB Out = Y OOP SGL In SGL Out = Y RSA PRIV OP KEY QT = Y +Symmetric sessionless = Y ; ; Supported crypto algorithms of 'octeontx' crypto driver. diff --git a/doc/guides/cryptodevs/features/octeontx2.ini b/doc/guides/cryptodevs/features/octeontx2.ini index 4693458865..e9ce26cfe0 100644 --- a/doc/guides/cryptodevs/features/octeontx2.ini +++ b/doc/guides/cryptodevs/features/octeontx2.ini @@ -12,6 +12,7 @@ In Place SGL = Y OOP SGL In LB Out = Y OOP SGL In SGL Out = Y RSA PRIV OP KEY QT = Y +Symmetric sessionless = Y ; ; Supported crypto algorithms of 'octeontx2' crypto driver. diff --git a/doc/guides/cryptodevs/features/openssl.ini b/doc/guides/cryptodevs/features/openssl.ini index 30ffb111dd..74bb987ecd 100644 --- a/doc/guides/cryptodevs/features/openssl.ini +++ b/doc/guides/cryptodevs/features/openssl.ini @@ -12,6 +12,7 @@ OOP LB In LB Out = Y Asymmetric crypto = Y RSA PRIV OP KEY EXP = Y RSA PRIV OP KEY QT = Y +Symmetric sessionless = Y ; ; Supported crypto algorithms of the 'openssl' crypto driver. diff --git a/doc/guides/cryptodevs/features/snow3g.ini b/doc/guides/cryptodevs/features/snow3g.ini index ec2daf6c64..8b971cc1da 100644 --- a/doc/guides/cryptodevs/features/snow3g.ini +++ b/doc/guides/cryptodevs/features/snow3g.ini @@ -6,6 +6,7 @@ [Features] Symmetric crypto = Y Sym operation chaining = Y +Symmetric sessionless = Y ; ; Supported crypto algorithms of the 'snow3g' crypto driver. @@ -26,4 +27,4 @@ SNOW3G UIA2 = Y ; ; Supported Asymmetric algorithms of the 'snow3g' crypto driver. ; -[Asymmetric] \ No newline at end of file +[Asymmetric] diff --git a/doc/guides/cryptodevs/features/zuc.ini b/doc/guides/cryptodevs/features/zuc.ini index 9b6a4287e8..f7bff4291c 100644 --- a/doc/guides/cryptodevs/features/zuc.ini +++ b/doc/guides/cryptodevs/features/zuc.ini @@ -6,6 +6,7 @@ [Features] Symmetric crypto = Y Sym operation chaining = Y +Symmetric sessionless = Y ; ; Supported crypto algorithms of the 'zuc' crypto driver. diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c index 475d523ae1..d213d05b93 100644 --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c @@ -744,7 +744,8 @@ aesni_gcm_create(const char *name, RTE_CRYPTODEV_FF_IN_PLACE_SGL | RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT | RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT | - RTE_CRYPTODEV_FF_SYM_CPU_CRYPTO; + RTE_CRYPTODEV_FF_SYM_CPU_CRYPTO | + RTE_CRYPTODEV_FF_SYM_SESSIONLESS; /* Check CPU for support for AES instruction set */ if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AES)) diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c index 8609717722..a1d59e89b7 100644 --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c @@ -1621,7 +1621,8 @@ cryptodev_aesni_mb_create(const char *name, dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO | RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING | RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT | - RTE_CRYPTODEV_FF_SYM_CPU_CRYPTO; + RTE_CRYPTODEV_FF_SYM_CPU_CRYPTO | + RTE_CRYPTODEV_FF_SYM_SESSIONLESS; /* Check CPU for support for AES instruction set */ if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AES)) diff --git a/drivers/crypto/armv8/rte_armv8_pmd.c b/drivers/crypto/armv8/rte_armv8_pmd.c index d2b7ab5e03..8b212772fa 100644 --- a/drivers/crypto/armv8/rte_armv8_pmd.c +++ b/drivers/crypto/armv8/rte_armv8_pmd.c @@ -792,7 +792,8 @@ cryptodev_armv8_crypto_create(const char *name, dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO | RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING | RTE_CRYPTODEV_FF_CPU_NEON | - RTE_CRYPTODEV_FF_CPU_ARM_CE; + RTE_CRYPTODEV_FF_CPU_ARM_CE | + RTE_CRYPTODEV_FF_SYM_SESSIONLESS; internals = dev->data->dev_private; diff --git a/drivers/crypto/ccp/rte_ccp_pmd.c b/drivers/crypto/ccp/rte_ccp_pmd.c index f6ea008444..000b2f4fe0 100644 --- a/drivers/crypto/ccp/rte_ccp_pmd.c +++ b/drivers/crypto/ccp/rte_ccp_pmd.c @@ -352,7 +352,8 @@ cryptodev_ccp_create(const char *name, dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO | RTE_CRYPTODEV_FF_HW_ACCELERATED | - RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING; + RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING | + RTE_CRYPTODEV_FF_SYM_SESSIONLESS; internals = dev->data->dev_private; diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd.c b/drivers/crypto/kasumi/rte_kasumi_pmd.c index d672648420..a20921249b 100644 --- a/drivers/crypto/kasumi/rte_kasumi_pmd.c +++ b/drivers/crypto/kasumi/rte_kasumi_pmd.c @@ -550,7 +550,8 @@ cryptodev_kasumi_create(const char *name, dev->enqueue_burst = kasumi_pmd_enqueue_burst; dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO | - RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING; + RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING | + RTE_CRYPTODEV_FF_SYM_SESSIONLESS; mgr = alloc_mb_mgr(0); if (mgr == NULL) diff --git a/drivers/crypto/null/null_crypto_pmd.c b/drivers/crypto/null/null_crypto_pmd.c index f11636c5f9..7b0b9d42b4 100644 --- a/drivers/crypto/null/null_crypto_pmd.c +++ b/drivers/crypto/null/null_crypto_pmd.c @@ -178,7 +178,8 @@ cryptodev_null_create(const char *name, dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO | RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING | - RTE_CRYPTODEV_FF_IN_PLACE_SGL; + RTE_CRYPTODEV_FF_IN_PLACE_SGL | + RTE_CRYPTODEV_FF_SYM_SESSIONLESS; internals = dev->data->dev_private; diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c b/drivers/crypto/octeontx/otx_cryptodev_ops.c index 120e7fcc06..3fbf5d5368 100644 --- a/drivers/crypto/octeontx/otx_cryptodev_ops.c +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c @@ -967,7 +967,8 @@ otx_cpt_dev_create(struct rte_cryptodev *c_dev) RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING | RTE_CRYPTODEV_FF_IN_PLACE_SGL | RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT | - RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT; + RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT | + RTE_CRYPTODEV_FF_SYM_SESSIONLESS; break; default: /* Feature not supported. Abort */ diff --git a/drivers/crypto/octeontx2/otx2_cryptodev.c b/drivers/crypto/octeontx2/otx2_cryptodev.c index 417eda6de6..7cda077e1b 100644 --- a/drivers/crypto/octeontx2/otx2_cryptodev.c +++ b/drivers/crypto/octeontx2/otx2_cryptodev.c @@ -103,7 +103,8 @@ otx2_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT | RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT | RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO | - RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT; + RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT | + RTE_CRYPTODEV_FF_SYM_SESSIONLESS; return 0; diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c index c294f60b7d..bb9fb877a6 100644 --- a/drivers/crypto/openssl/rte_openssl_pmd.c +++ b/drivers/crypto/openssl/rte_openssl_pmd.c @@ -2207,7 +2207,8 @@ cryptodev_openssl_create(const char *name, RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT | RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO | RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_EXP | - RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT; + RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT | + RTE_CRYPTODEV_FF_SYM_SESSIONLESS; internals = dev->data->dev_private; diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd.c b/drivers/crypto/snow3g/rte_snow3g_pmd.c index 8101eaaada..8e82dde552 100644 --- a/drivers/crypto/snow3g/rte_snow3g_pmd.c +++ b/drivers/crypto/snow3g/rte_snow3g_pmd.c @@ -562,7 +562,8 @@ cryptodev_snow3g_create(const char *name, dev->enqueue_burst = snow3g_pmd_enqueue_burst; dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO | - RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING; + RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING | + RTE_CRYPTODEV_FF_SYM_SESSIONLESS; mgr = alloc_mb_mgr(0); if (mgr == NULL) diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c b/drivers/crypto/zuc/rte_zuc_pmd.c index f47a7880de..17926b4714 100644 --- a/drivers/crypto/zuc/rte_zuc_pmd.c +++ b/drivers/crypto/zuc/rte_zuc_pmd.c @@ -469,7 +469,8 @@ cryptodev_zuc_create(const char *name, } dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO | - RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING; + RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING | + RTE_CRYPTODEV_FF_SYM_SESSIONLESS; mb_mgr = alloc_mb_mgr(0); if (mb_mgr == NULL) diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index f2ade83d3c..2849b2e7da 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -497,6 +497,8 @@ rte_cryptodev_get_feature_name(uint64_t flag) return "SYM_CPU_CRYPTO"; case RTE_CRYPTODEV_FF_ASYM_SESSIONLESS: return "ASYM_SESSIONLESS"; + case RTE_CRYPTODEV_FF_SYM_SESSIONLESS: + return "SYM_SESSIONLESS"; default: return NULL; } diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h index 437b8a9b31..f4846d2a70 100644 --- a/lib/librte_cryptodev/rte_cryptodev.h +++ b/lib/librte_cryptodev/rte_cryptodev.h @@ -452,6 +452,8 @@ rte_cryptodev_asym_get_xform_enum(enum rte_crypto_asym_xform_type *xform_enum, /**< Support asymmetric session-less operations */ #define RTE_CRYPTODEV_FF_SYM_CPU_CRYPTO (1ULL << 21) /**< Support symmetric cpu-crypto processing */ +#define RTE_CRYPTODEV_FF_SYM_SESSIONLESS (1ULL << 22) +/**< Support symmetric session-less operations */ /** -- 2.20.1