cryptodev: add feature flag for non-byte aligned data
authorAkhil Goyal <akhil.goyal@nxp.com>
Sat, 9 May 2020 23:12:09 +0000 (04:42 +0530)
committerAkhil Goyal <akhil.goyal@nxp.com>
Mon, 11 May 2020 11:17:43 +0000 (13:17 +0200)
Some wireless algos like SNOW, ZUC may support input
data in bits which are not byte aligned. However, not
all PMDs can support this requirement. Hence added a
new feature flag RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA
to identify which all PMDs can support non-byte aligned
data.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
doc/guides/cryptodevs/features/default.ini
doc/guides/cryptodevs/features/kasumi.ini
doc/guides/cryptodevs/features/snow3g.ini
doc/guides/cryptodevs/features/zuc.ini
drivers/crypto/kasumi/rte_kasumi_pmd.c
drivers/crypto/snow3g/rte_snow3g_pmd.c
drivers/crypto/zuc/rte_zuc_pmd.c
lib/librte_cryptodev/rte_cryptodev.c
lib/librte_cryptodev/rte_cryptodev.h

index 118479d..fb1ddca 100644 (file)
@@ -29,6 +29,7 @@ Digest encrypted       =
 Asymmetric sessionless =
 CPU crypto             =
 Symmetric sessionless  =
+Non-Byte aligned data  =
 
 ;
 ; Supported crypto algorithms of a default crypto driver.
index 99ded04..8380a57 100644 (file)
@@ -7,6 +7,7 @@
 Symmetric crypto       = Y
 Sym operation chaining = Y
 Symmetric sessionless  = Y
+Non-Byte aligned data  = Y
 
 ;
 ; Supported crypto algorithms of the 'kasumi' crypto driver.
index 8b971cc..b2caefe 100644 (file)
@@ -7,6 +7,7 @@
 Symmetric crypto       = Y
 Sym operation chaining = Y
 Symmetric sessionless  = Y
+Non-Byte aligned data  = Y
 
 ;
 ; Supported crypto algorithms of the 'snow3g' crypto driver.
index f7bff42..21d074f 100644 (file)
@@ -7,6 +7,7 @@
 Symmetric crypto       = Y
 Sym operation chaining = Y
 Symmetric sessionless  = Y
+Non-Byte aligned data  = Y
 
 ;
 ; Supported crypto algorithms of the 'zuc' crypto driver.
index a209212..73077e3 100644 (file)
@@ -551,6 +551,7 @@ cryptodev_kasumi_create(const char *name,
 
        dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO |
                        RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING |
+                       RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA |
                        RTE_CRYPTODEV_FF_SYM_SESSIONLESS;
 
        mgr = alloc_mb_mgr(0);
index 8e82dde..c939064 100644 (file)
@@ -563,6 +563,7 @@ cryptodev_snow3g_create(const char *name,
 
        dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO |
                        RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING |
+                       RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA |
                        RTE_CRYPTODEV_FF_SYM_SESSIONLESS;
 
        mgr = alloc_mb_mgr(0);
index 17926b4..4598818 100644 (file)
@@ -470,6 +470,7 @@ cryptodev_zuc_create(const char *name,
 
        dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO |
                        RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING |
+                       RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA |
                        RTE_CRYPTODEV_FF_SYM_SESSIONLESS;
 
        mb_mgr = alloc_mb_mgr(0);
index 7693eb6..f30e3cb 100644 (file)
@@ -500,6 +500,8 @@ rte_cryptodev_get_feature_name(uint64_t flag)
                return "ASYM_SESSIONLESS";
        case RTE_CRYPTODEV_FF_SYM_SESSIONLESS:
                return "SYM_SESSIONLESS";
+       case RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA:
+               return "NON_BYTE_ALIGNED_DATA";
        default:
                return NULL;
        }
index 3dbb5ce..257840e 100644 (file)
@@ -456,6 +456,8 @@ rte_cryptodev_asym_get_xform_enum(enum rte_crypto_asym_xform_type *xform_enum,
 /**< Support symmetric cpu-crypto processing */
 #define RTE_CRYPTODEV_FF_SYM_SESSIONLESS               (1ULL << 22)
 /**< Support symmetric session-less operations */
+#define RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA         (1ULL << 23)
+/**< Support operations on data which is not byte aligned */
 
 
 /**