DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup
@ 2020-05-04 21:58 Akhil Goyal
  2020-05-04 21:58 ` [dpdk-dev] [PATCH 1/9] cryptodev: add feature flag for non-byte aligned data Akhil Goyal
                   ` (11 more replies)
  0 siblings, 12 replies; 32+ messages in thread
From: Akhil Goyal @ 2020-05-04 21:58 UTC (permalink / raw)
  To: dev
  Cc: Ruifeng.Wang, declan.doherty, asomalap, anoobj, roy.fan.zhang,
	fiona.trahe, tdu, rnagadheeraj, adwivedi, G.Singh,
	hemant.agrawal, jianjay.zhou, pablo.de.lara.guarch, Akhil Goyal

Certain cases were put in PMD specific checks which
should be avoided. Appropriate capability/supported
feature flag should be checked before executing the
test case.
Added 1 missing feature flag for non-byte aligned data
Enabled it for SNOW/ZUC/KASUMI PMDs.
All the PMD owners are requested to verify these changes
and let me know in case there are some issues.

Also removed PMD specific testsuite for dpaa_sec and dpaa2_sec.
It is requested to all PMD owners to remove their PMD specific
suites and move to generic testsuite.

Akhil Goyal (9):
  cryptodev: add feature flag for non-byte aligned data
  test/crypto: skip unsupported non-byte aligned cases
  test/crypto: skip unsupported SG cases
  test/crypto: skip unsupported sessionless cases
  test/crypto: skip unsupported session
  test/crypto: run PDCP cases if supported
  test/crypto: remove dpaaX_sec specific testsuites
  test/crypto: remove QAT specific check
  test/crypto: remove unused variable

 app/test/test_cryptodev.c                  | 845 +++++----------------
 doc/guides/cryptodevs/features/default.ini |   1 +
 doc/guides/cryptodevs/features/kasumi.ini  |   1 +
 doc/guides/cryptodevs/features/snow3g.ini  |   1 +
 doc/guides/cryptodevs/features/zuc.ini     |   1 +
 drivers/crypto/kasumi/rte_kasumi_pmd.c     |   1 +
 drivers/crypto/snow3g/rte_snow3g_pmd.c     |   1 +
 drivers/crypto/zuc/rte_zuc_pmd.c           |   1 +
 lib/librte_cryptodev/rte_cryptodev.c       |   2 +
 lib/librte_cryptodev/rte_cryptodev.h       |   2 +
 10 files changed, 194 insertions(+), 662 deletions(-)

-- 
2.17.1


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

* [dpdk-dev] [PATCH 1/9] cryptodev: add feature flag for non-byte aligned data
  2020-05-04 21:58 [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup Akhil Goyal
@ 2020-05-04 21:58 ` Akhil Goyal
  2020-05-05  9:57   ` Trahe, Fiona
  2020-05-04 21:58 ` [dpdk-dev] [PATCH 2/9] test/crypto: skip unsupported non-byte aligned cases Akhil Goyal
                   ` (10 subsequent siblings)
  11 siblings, 1 reply; 32+ messages in thread
From: Akhil Goyal @ 2020-05-04 21:58 UTC (permalink / raw)
  To: dev
  Cc: Ruifeng.Wang, declan.doherty, asomalap, anoobj, roy.fan.zhang,
	fiona.trahe, tdu, rnagadheeraj, adwivedi, G.Singh,
	hemant.agrawal, jianjay.zhou, pablo.de.lara.guarch, Akhil Goyal

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>
---
 doc/guides/cryptodevs/features/default.ini | 1 +
 doc/guides/cryptodevs/features/kasumi.ini  | 1 +
 doc/guides/cryptodevs/features/snow3g.ini  | 1 +
 doc/guides/cryptodevs/features/zuc.ini     | 1 +
 drivers/crypto/kasumi/rte_kasumi_pmd.c     | 1 +
 drivers/crypto/snow3g/rte_snow3g_pmd.c     | 1 +
 drivers/crypto/zuc/rte_zuc_pmd.c           | 1 +
 lib/librte_cryptodev/rte_cryptodev.c       | 2 ++
 lib/librte_cryptodev/rte_cryptodev.h       | 2 ++
 9 files changed, 11 insertions(+)

diff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryptodevs/features/default.ini
index 118479db5..fb1ddca71 100644
--- a/doc/guides/cryptodevs/features/default.ini
+++ b/doc/guides/cryptodevs/features/default.ini
@@ -29,6 +29,7 @@ Digest encrypted       =
 Asymmetric sessionless =
 CPU crypto             =
 Symmetric sessionless  =
+Non-Byte aligned data  =
 
 ;
 ; 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 99ded0401..8380a5765 100644
--- a/doc/guides/cryptodevs/features/kasumi.ini
+++ b/doc/guides/cryptodevs/features/kasumi.ini
@@ -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.
diff --git a/doc/guides/cryptodevs/features/snow3g.ini b/doc/guides/cryptodevs/features/snow3g.ini
index 8b971cc1d..b2caefe3a 100644
--- a/doc/guides/cryptodevs/features/snow3g.ini
+++ b/doc/guides/cryptodevs/features/snow3g.ini
@@ -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.
diff --git a/doc/guides/cryptodevs/features/zuc.ini b/doc/guides/cryptodevs/features/zuc.ini
index f7bff4291..21d074f9b 100644
--- a/doc/guides/cryptodevs/features/zuc.ini
+++ b/doc/guides/cryptodevs/features/zuc.ini
@@ -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.
diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd.c b/drivers/crypto/kasumi/rte_kasumi_pmd.c
index a20921249..73077e3d9 100644
--- a/drivers/crypto/kasumi/rte_kasumi_pmd.c
+++ b/drivers/crypto/kasumi/rte_kasumi_pmd.c
@@ -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);
diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd.c b/drivers/crypto/snow3g/rte_snow3g_pmd.c
index 8e82dde55..c939064d5 100644
--- a/drivers/crypto/snow3g/rte_snow3g_pmd.c
+++ b/drivers/crypto/snow3g/rte_snow3g_pmd.c
@@ -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);
diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c b/drivers/crypto/zuc/rte_zuc_pmd.c
index 17926b471..459881873 100644
--- a/drivers/crypto/zuc/rte_zuc_pmd.c
+++ b/drivers/crypto/zuc/rte_zuc_pmd.c
@@ -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);
diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 7693eb69c..f30e3cbff 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -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;
 	}
diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h
index 3dbb5ceb2..257840ea4 100644
--- a/lib/librte_cryptodev/rte_cryptodev.h
+++ b/lib/librte_cryptodev/rte_cryptodev.h
@@ -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 */
 
 
 /**
-- 
2.17.1


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

* [dpdk-dev] [PATCH 2/9] test/crypto: skip unsupported non-byte aligned cases
  2020-05-04 21:58 [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup Akhil Goyal
  2020-05-04 21:58 ` [dpdk-dev] [PATCH 1/9] cryptodev: add feature flag for non-byte aligned data Akhil Goyal
@ 2020-05-04 21:58 ` Akhil Goyal
  2020-05-04 21:58 ` [dpdk-dev] [PATCH 3/9] test/crypto: skip unsupported SG cases Akhil Goyal
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 32+ messages in thread
From: Akhil Goyal @ 2020-05-04 21:58 UTC (permalink / raw)
  To: dev
  Cc: Ruifeng.Wang, declan.doherty, asomalap, anoobj, roy.fan.zhang,
	fiona.trahe, tdu, rnagadheeraj, adwivedi, G.Singh,
	hemant.agrawal, jianjay.zhou, pablo.de.lara.guarch, Akhil Goyal,
	Apeksha Gupta

Skipped the test cases for the PMDs which do not support
RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA and subsequently
removed the PMD specific checks for running that case.

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 app/test/test_cryptodev.c | 68 +++++++++++++++++++++++++--------------
 1 file changed, 43 insertions(+), 25 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 988e58b3a..df2c56c90 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -2461,12 +2461,16 @@ test_snow3g_authentication(const struct snow3g_hash_test_data *tdata)
 	unsigned plaintext_pad_len;
 	unsigned plaintext_len;
 	uint8_t *plaintext;
+	struct rte_cryptodev_info dev_info;
 
-	/* QAT PMD supports byte-aligned data only */
-	if ((tdata->validAuthLenInBits.len % 8 != 0) &&
-			(gbl_driver_id == rte_cryptodev_driver_id_get(
-				RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD))))
+	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+	uint64_t feat_flags = dev_info.feature_flags;
+
+	if (!(feat_flags & RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA) &&
+			((tdata->validAuthLenInBits.len % 8) != 0)) {
+		printf("Device doesn't support NON-Byte Aligned Data.\n");
 		return -ENOTSUP;
+	}
 
 	/* Verify the capabilities */
 	struct rte_cryptodev_sym_capability_idx cap_idx;
@@ -2535,12 +2539,16 @@ test_snow3g_authentication_verify(const struct snow3g_hash_test_data *tdata)
 	unsigned plaintext_pad_len;
 	unsigned plaintext_len;
 	uint8_t *plaintext;
+	struct rte_cryptodev_info dev_info;
+
+	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+	uint64_t feat_flags = dev_info.feature_flags;
 
-	/* QAT PMD supports byte-aligned data only */
-	if ((tdata->validAuthLenInBits.len % 8 != 0) &&
-			(gbl_driver_id == rte_cryptodev_driver_id_get(
-				RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD))))
+	if (!(feat_flags & RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA) &&
+			((tdata->validAuthLenInBits.len % 8) != 0)) {
+		printf("Device doesn't support NON-Byte Aligned Data.\n");
 		return -ENOTSUP;
+	}
 
 	/* Verify the capabilities */
 	struct rte_cryptodev_sym_capability_idx cap_idx;
@@ -3639,11 +3647,16 @@ test_snow3g_encryption_offset_oop(const struct snow3g_test_data *tdata)
 	uint32_t plaintext_pad_len;
 	uint8_t extra_offset = 4;
 	uint8_t *expected_ciphertext_shifted;
+	struct rte_cryptodev_info dev_info;
 
-	/* QAT PMD supports byte-aligned data only */
-	if (gbl_driver_id == rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD)))
+	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+	uint64_t feat_flags = dev_info.feature_flags;
+
+	if (!(feat_flags & RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA) &&
+			((tdata->validDataLenInBits.len % 8) != 0)) {
+		printf("Device doesn't support NON-Byte Aligned Data.\n");
 		return -ENOTSUP;
+	}
 
 	/* Verify the capabilities */
 	struct rte_cryptodev_sym_capability_idx cap_idx;
@@ -3897,8 +3910,19 @@ test_zuc_cipher_auth(const struct wireless_test_data *tdata)
 	unsigned int plaintext_pad_len;
 	unsigned int plaintext_len;
 
+	struct rte_cryptodev_info dev_info;
 	struct rte_cryptodev_sym_capability_idx cap_idx;
 
+	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+	uint64_t feat_flags = dev_info.feature_flags;
+
+	if (!(feat_flags & RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA) &&
+			((tdata->validAuthLenInBits.len % 8 != 0) ||
+			(tdata->validDataLenInBits.len % 8 != 0))) {
+		printf("Device doesn't support NON-Byte Aligned Data.\n");
+		return -ENOTSUP;
+	}
+
 	/* Check if device supports ZUC EEA3 */
 	cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_ZUC_EEA3;
@@ -5086,12 +5110,16 @@ test_zuc_authentication(const struct wireless_test_data *tdata)
 	uint8_t *plaintext;
 
 	struct rte_cryptodev_sym_capability_idx cap_idx;
+	struct rte_cryptodev_info dev_info;
 
-	/* QAT PMD supports byte-aligned data only */
-	if ((tdata->validAuthLenInBits.len % 8 != 0) &&
-			(gbl_driver_id == rte_cryptodev_driver_id_get(
-				RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD))))
+	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+	uint64_t feat_flags = dev_info.feature_flags;
+
+	if (!(feat_flags & RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA) &&
+			(tdata->validAuthLenInBits.len % 8 != 0)) {
+		printf("Device doesn't support NON-Byte Aligned Data.\n");
 		return -ENOTSUP;
+	}
 
 	/* Check if device supports ZUC EIA3 */
 	cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
@@ -6032,11 +6060,6 @@ test_zuc_hash_generate_test_case_6(void)
 static int
 test_zuc_hash_generate_test_case_7(void)
 {
-	/* This test is not for SW ZUC PMD */
-	if (gbl_driver_id == rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_ZUC_PMD)))
-		return -ENOTSUP;
-
 	return test_zuc_authentication(&zuc_test_case_auth_2080b);
 }
 
@@ -6061,11 +6084,6 @@ test_zuc_cipher_auth_test_case_2(void)
 static int
 test_zuc_auth_cipher_test_case_1(void)
 {
-	/* This test is not for SW ZUC PMD */
-	if (gbl_driver_id == rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_ZUC_PMD)))
-		return -ENOTSUP;
-
 	return test_zuc_auth_cipher(
 		&zuc_auth_cipher_test_case_1, IN_PLACE, 0);
 }
-- 
2.17.1


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

* [dpdk-dev] [PATCH 3/9] test/crypto: skip unsupported SG cases
  2020-05-04 21:58 [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup Akhil Goyal
  2020-05-04 21:58 ` [dpdk-dev] [PATCH 1/9] cryptodev: add feature flag for non-byte aligned data Akhil Goyal
  2020-05-04 21:58 ` [dpdk-dev] [PATCH 2/9] test/crypto: skip unsupported non-byte aligned cases Akhil Goyal
@ 2020-05-04 21:58 ` Akhil Goyal
  2020-05-04 21:58 ` [dpdk-dev] [PATCH 4/9] test/crypto: skip unsupported sessionless cases Akhil Goyal
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 32+ messages in thread
From: Akhil Goyal @ 2020-05-04 21:58 UTC (permalink / raw)
  To: dev
  Cc: Ruifeng.Wang, declan.doherty, asomalap, anoobj, roy.fan.zhang,
	fiona.trahe, tdu, rnagadheeraj, adwivedi, G.Singh,
	hemant.agrawal, jianjay.zhou, pablo.de.lara.guarch, Akhil Goyal,
	Apeksha Gupta

Checked the PMD feature flag list to identify if
inplace or OOP SGLs are supported or not. If not supported
the cases are skipped.

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 app/test/test_cryptodev.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index df2c56c90..c13f8f73f 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -5212,6 +5212,19 @@ test_zuc_auth_cipher(const struct wireless_test_data *tdata,
 		printf("Device doesn't support digest encrypted.\n");
 		return -ENOTSUP;
 	}
+	if (op_mode == IN_PLACE) {
+		if (!(feat_flags & RTE_CRYPTODEV_FF_IN_PLACE_SGL)) {
+			printf("Device doesn't support in-place scatter-gather "
+					"in both input and output mbufs.\n");
+			return -ENOTSUP;
+		}
+	} else {
+		if (!(feat_flags & RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT)) {
+			printf("Device doesn't support out-of-place scatter-gather "
+					"in both input and output mbufs.\n");
+			return -ENOTSUP;
+		}
+	}
 
 	/* Create ZUC session */
 	retval = create_wireless_algo_auth_cipher_session(
-- 
2.17.1


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

* [dpdk-dev] [PATCH 4/9] test/crypto: skip unsupported sessionless cases
  2020-05-04 21:58 [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup Akhil Goyal
                   ` (2 preceding siblings ...)
  2020-05-04 21:58 ` [dpdk-dev] [PATCH 3/9] test/crypto: skip unsupported SG cases Akhil Goyal
@ 2020-05-04 21:58 ` Akhil Goyal
  2020-05-04 21:58 ` [dpdk-dev] [PATCH 5/9] test/crypto: skip unsupported session Akhil Goyal
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 32+ messages in thread
From: Akhil Goyal @ 2020-05-04 21:58 UTC (permalink / raw)
  To: dev
  Cc: Ruifeng.Wang, declan.doherty, asomalap, anoobj, roy.fan.zhang,
	fiona.trahe, tdu, rnagadheeraj, adwivedi, G.Singh,
	hemant.agrawal, jianjay.zhou, pablo.de.lara.guarch, Akhil Goyal,
	Apeksha Gupta

There were some PMD specific checks to skip the case if
it is not supported. This patch checks the feature flag
RTE_CRYPTODEV_FF_SYM_SESSIONLESS if PMD supports it or not.

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 app/test/test_cryptodev.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index c13f8f73f..e3df51985 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -8484,13 +8484,15 @@ test_authenticated_encryption_sessionless(
 	uint8_t *ciphertext, *auth_tag;
 	uint16_t plaintext_pad_len;
 	uint8_t key[tdata->key.len + 1];
+	struct rte_cryptodev_info dev_info;
 
-	/* This test is for AESNI MB and AESNI GCM PMDs only */
-	if ((gbl_driver_id != rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD))) &&
-			(gbl_driver_id != rte_cryptodev_driver_id_get(
-				RTE_STR(CRYPTODEV_NAME_AESNI_GCM_PMD))))
+	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+	uint64_t feat_flags = dev_info.feature_flags;
+
+	if (!(feat_flags & RTE_CRYPTODEV_FF_SYM_SESSIONLESS)) {
+		printf("Device doesn't support Sessionless ops.\n");
 		return -ENOTSUP;
+	}
 
 	/* not supported with CPU crypto */
 	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
@@ -8584,13 +8586,15 @@ test_authenticated_decryption_sessionless(
 	int retval;
 	uint8_t *plaintext;
 	uint8_t key[tdata->key.len + 1];
+	struct rte_cryptodev_info dev_info;
 
-	/* This test is for AESNI MB and AESNI GCM PMDs only */
-	if ((gbl_driver_id != rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD))) &&
-			(gbl_driver_id != rte_cryptodev_driver_id_get(
-				RTE_STR(CRYPTODEV_NAME_AESNI_GCM_PMD))))
+	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+	uint64_t feat_flags = dev_info.feature_flags;
+
+	if (!(feat_flags & RTE_CRYPTODEV_FF_SYM_SESSIONLESS)) {
+		printf("Device doesn't support Sessionless ops.\n");
 		return -ENOTSUP;
+	}
 
 	/* not supported with CPU crypto */
 	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
-- 
2.17.1


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

* [dpdk-dev] [PATCH 5/9] test/crypto: skip unsupported session
  2020-05-04 21:58 [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup Akhil Goyal
                   ` (3 preceding siblings ...)
  2020-05-04 21:58 ` [dpdk-dev] [PATCH 4/9] test/crypto: skip unsupported sessionless cases Akhil Goyal
@ 2020-05-04 21:58 ` Akhil Goyal
  2020-05-04 21:58 ` [dpdk-dev] [PATCH 6/9] test/crypto: run PDCP cases if supported Akhil Goyal
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 32+ messages in thread
From: Akhil Goyal @ 2020-05-04 21:58 UTC (permalink / raw)
  To: dev
  Cc: Ruifeng.Wang, declan.doherty, asomalap, anoobj, roy.fan.zhang,
	fiona.trahe, tdu, rnagadheeraj, adwivedi, G.Singh,
	hemant.agrawal, jianjay.zhou, pablo.de.lara.guarch, Akhil Goyal

The session init routine rte_cryptodev_sym_session_init(),
could return -ENOTSUP when the requested algo combination
is not supported by the PMD. This should be treated as
unsupported feature.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 app/test/test_cryptodev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index e3df51985..d86bdbf8e 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -2050,6 +2050,8 @@ create_wireless_cipher_auth_session(uint8_t dev_id,
 	status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess,
 			&ut_params->cipher_xform,
 			ts_params->session_priv_mpool);
+	if (status == -ENOTSUP)
+		return status;
 
 	TEST_ASSERT_EQUAL(status, 0, "session init failed");
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
-- 
2.17.1


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

* [dpdk-dev] [PATCH 6/9] test/crypto: run PDCP cases if supported
  2020-05-04 21:58 [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup Akhil Goyal
                   ` (4 preceding siblings ...)
  2020-05-04 21:58 ` [dpdk-dev] [PATCH 5/9] test/crypto: skip unsupported session Akhil Goyal
@ 2020-05-04 21:58 ` Akhil Goyal
  2020-05-04 21:58 ` [dpdk-dev] [PATCH 7/9] test/crypto: remove dpaaX_sec specific testsuites Akhil Goyal
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 32+ messages in thread
From: Akhil Goyal @ 2020-05-04 21:58 UTC (permalink / raw)
  To: dev
  Cc: Ruifeng.Wang, declan.doherty, asomalap, anoobj, roy.fan.zhang,
	fiona.trahe, tdu, rnagadheeraj, adwivedi, G.Singh,
	hemant.agrawal, jianjay.zhou, pablo.de.lara.guarch, Akhil Goyal

cryptodevs which support rte_security PDCP protocol,
can run all PDCP cases if it sets a feature flag
RTE_CRYPTODEV_FF_SECURITY. Previously, only dpaa2_sec
and dpaa_sec test suites were running these tests.
Now it is moved to generic test suite with a check
on the feature flag and the case will be skipped if it
is not supported by the PMD.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 app/test/test_cryptodev.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index d86bdbf8e..b2b215737 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -7719,6 +7719,34 @@ test_PDCP_PROTO_SGL_oop_128B_32B(void)
 			pdcp_test_data_in_len[i]+4,
 			128, 32);
 }
+
+static int
+test_PDCP_PROTO_all(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct rte_cryptodev_info dev_info;
+	int status;
+
+	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+	uint64_t feat_flags = dev_info.feature_flags;
+
+	if (!(feat_flags & RTE_CRYPTODEV_FF_SECURITY))
+		return -ENOTSUP;
+
+	status = test_PDCP_PROTO_cplane_encap_all();
+	status += test_PDCP_PROTO_cplane_decap_all();
+	status += test_PDCP_PROTO_uplane_encap_all();
+	status += test_PDCP_PROTO_uplane_decap_all();
+	status += test_PDCP_PROTO_SGL_in_place_32B();
+	status += test_PDCP_PROTO_SGL_oop_32B_128B();
+	status += test_PDCP_PROTO_SGL_oop_32B_40B();
+	status += test_PDCP_PROTO_SGL_oop_128B_32B();
+
+	if (status)
+		return TEST_FAILED;
+	else
+		return TEST_SUCCESS;
+}
 #endif
 
 static int
@@ -12379,6 +12407,10 @@ static struct unit_test_suite cryptodev_testsuite  = {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_verify_auth_aes_cmac_cipher_null_test_case_1),
 
+#ifdef RTE_LIBRTE_SECURITY
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_PDCP_PROTO_all),
+#endif
 		TEST_CASES_END() /**< NULL terminate unit test array */
 	}
 };
-- 
2.17.1


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

* [dpdk-dev] [PATCH 7/9] test/crypto: remove dpaaX_sec specific testsuites
  2020-05-04 21:58 [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup Akhil Goyal
                   ` (5 preceding siblings ...)
  2020-05-04 21:58 ` [dpdk-dev] [PATCH 6/9] test/crypto: run PDCP cases if supported Akhil Goyal
@ 2020-05-04 21:58 ` Akhil Goyal
  2020-05-04 21:58 ` [dpdk-dev] [PATCH 8/9] test/crypto: remove QAT specific check Akhil Goyal
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 32+ messages in thread
From: Akhil Goyal @ 2020-05-04 21:58 UTC (permalink / raw)
  To: dev
  Cc: Ruifeng.Wang, declan.doherty, asomalap, anoobj, roy.fan.zhang,
	fiona.trahe, tdu, rnagadheeraj, adwivedi, G.Singh,
	hemant.agrawal, jianjay.zhou, pablo.de.lara.guarch, Akhil Goyal,
	Apeksha Gupta

dpaa_sec and dpaa2_sec PMDs can run generic
cryptodev_testsuite. Hence removing the specific
test suites.

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 app/test/test_cryptodev.c | 534 +-------------------------------------
 1 file changed, 2 insertions(+), 532 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index b2b215737..08a12af25 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -12446,536 +12446,6 @@ static struct unit_test_suite cryptodev_caam_jr_testsuite  = {
 	}
 };
 
-static struct unit_test_suite cryptodev_dpaa_sec_testsuite  = {
-	.suite_name = "Crypto DPAA_SEC Unit Test Suite",
-	.setup = testsuite_setup,
-	.teardown = testsuite_teardown,
-	.unit_test_cases = {
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			     test_device_configure_invalid_dev_id),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			     test_multi_session),
-
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_chain_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all),
-
-#ifdef RTE_LIBRTE_SECURITY
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_cplane_encap_all),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_cplane_decap_all),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_uplane_encap_all),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_uplane_decap_all),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_SGL_in_place_32B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_SGL_oop_32B_128B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_SGL_oop_32B_40B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_SGL_oop_128B_32B),
-#endif
-		/** AES GCM Authenticated Encryption */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encrypt_SGL_in_place_1500B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encrypt_SGL_out_of_place_400B_400B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encrypt_SGL_out_of_place_1500B_2000B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encrypt_SGL_out_of_place_400B_1seg),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_7),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_8),
-
-		/** AES GCM Authenticated Decryption */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_7),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_8),
-
-		/** AES GCM Authenticated Encryption 192 bits key */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_7),
-
-		/** AES GCM Authenticated Decryption 192 bits key */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_7),
-
-		/** AES GCM Authenticated Encryption 256 bits key */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_7),
-
-		/** AES GCM Authenticated Decryption 256 bits key */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_7),
-
-		/** Out of place tests */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_oop_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_oop_test_case_1),
-
-		/** SNOW 3G encrypt only (UEA2) */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_5),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_1_oop),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-				test_snow3g_encryption_test_case_1_oop_sgl),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_1_oop),
-
-		/** SNOW 3G decrypt only (UEA2) */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_5),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_generate_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_generate_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_generate_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_verify_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_verify_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_verify_test_case_3),
-
-		/** ZUC encrypt only (EEA3) */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_encryption_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_encryption_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_encryption_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_encryption_test_case_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_encryption_test_case_5),
-
-		/** ZUC authenticate (EIA3) */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_generate_test_case_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_generate_test_case_7),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_generate_test_case_8),
-
-		/** Negative tests */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_iv_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_in_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_out_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_aad_len_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_aad_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_tag_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_iv_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_in_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_out_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_aad_len_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_aad_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_tag_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			authentication_verify_HMAC_SHA1_fail_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			authentication_verify_HMAC_SHA1_fail_tag_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			auth_decryption_AES128CBC_HMAC_SHA1_fail_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt),
-
-		/* ESN Testcase */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			auth_encrypt_AES128CBC_HMAC_SHA1_esn_check),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			auth_decrypt_AES128CBC_HMAC_SHA1_esn_check),
-
-		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
-};
-
-static struct unit_test_suite cryptodev_dpaa2_sec_testsuite  = {
-	.suite_name = "Crypto DPAA2_SEC Unit Test Suite",
-	.setup = testsuite_setup,
-	.teardown = testsuite_teardown,
-	.unit_test_cases = {
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_device_configure_invalid_dev_id),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_multi_session),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_chain_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all),
-
-#ifdef RTE_LIBRTE_SECURITY
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_cplane_encap_all),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_cplane_decap_all),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_uplane_encap_all),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_uplane_decap_all),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_SGL_in_place_32B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_SGL_oop_32B_128B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_SGL_oop_32B_40B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_SGL_oop_128B_32B),
-#endif
-		/** AES GCM Authenticated Encryption */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encrypt_SGL_in_place_1500B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encrypt_SGL_out_of_place_400B_400B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encrypt_SGL_out_of_place_1500B_2000B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encrypt_SGL_out_of_place_400B_1seg),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_7),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_8),
-
-		/** AES GCM Authenticated Decryption */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_7),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_8),
-
-		/** AES GCM Authenticated Encryption 192 bits key */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_7),
-
-		/** AES GCM Authenticated Decryption 192 bits key */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_7),
-
-		/** AES GCM Authenticated Encryption 256 bits key */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_7),
-
-		/** AES GCM Authenticated Decryption 256 bits key */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_7),
-
-		/** Out of place tests */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_oop_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_oop_test_case_1),
-
-		/** SNOW 3G encrypt only (UEA2) */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_5),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_1_oop),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-				test_snow3g_encryption_test_case_1_oop_sgl),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_1_oop),
-
-		/** SNOW 3G decrypt only (UEA2) */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_5),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_generate_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_generate_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_generate_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_verify_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_verify_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_verify_test_case_3),
-
-		/** ZUC encrypt only (EEA3) */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_encryption_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_encryption_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_encryption_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_encryption_test_case_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_encryption_test_case_5),
-
-		/** ZUC authenticate (EIA3) */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_generate_test_case_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_generate_test_case_7),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_generate_test_case_8),
-
-		/** HMAC_MD5 Authentication */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_MD5_HMAC_generate_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_MD5_HMAC_verify_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_MD5_HMAC_generate_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_MD5_HMAC_verify_case_2),
-
-		/** Negative tests */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_iv_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_in_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_out_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_aad_len_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_aad_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_tag_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_iv_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_in_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_out_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_aad_len_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_aad_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_tag_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			authentication_verify_HMAC_SHA1_fail_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			authentication_verify_HMAC_SHA1_fail_tag_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			auth_decryption_AES128CBC_HMAC_SHA1_fail_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt),
-
-		/* ESN Testcase */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			auth_encrypt_AES128CBC_HMAC_SHA1_esn_check),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			auth_decrypt_AES128CBC_HMAC_SHA1_esn_check),
-
-		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
-};
-
 static struct unit_test_suite cryptodev_armv8_testsuite  = {
 	.suite_name = "Crypto Device ARMv8 Unit Test Suite",
 	.setup = testsuite_setup,
@@ -13742,7 +13212,7 @@ test_cryptodev_dpaa2_sec(void /*argv __rte_unused, int argc __rte_unused*/)
 		return TEST_SKIPPED;
 	}
 
-	return unit_test_suite_runner(&cryptodev_dpaa2_sec_testsuite);
+	return unit_test_suite_runner(&cryptodev_testsuite);
 }
 
 static int
@@ -13758,7 +13228,7 @@ test_cryptodev_dpaa_sec(void /*argv __rte_unused, int argc __rte_unused*/)
 		return TEST_SKIPPED;
 	}
 
-	return unit_test_suite_runner(&cryptodev_dpaa_sec_testsuite);
+	return unit_test_suite_runner(&cryptodev_testsuite);
 }
 
 static int
-- 
2.17.1


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

* [dpdk-dev] [PATCH 8/9] test/crypto: remove QAT specific check
  2020-05-04 21:58 [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup Akhil Goyal
                   ` (6 preceding siblings ...)
  2020-05-04 21:58 ` [dpdk-dev] [PATCH 7/9] test/crypto: remove dpaaX_sec specific testsuites Akhil Goyal
@ 2020-05-04 21:58 ` Akhil Goyal
  2020-05-04 21:58 ` [dpdk-dev] [PATCH 9/9] test/crypto: remove unused variable Akhil Goyal
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 32+ messages in thread
From: Akhil Goyal @ 2020-05-04 21:58 UTC (permalink / raw)
  To: dev
  Cc: Ruifeng.Wang, declan.doherty, asomalap, anoobj, roy.fan.zhang,
	fiona.trahe, tdu, rnagadheeraj, adwivedi, G.Singh,
	hemant.agrawal, jianjay.zhou, pablo.de.lara.guarch, Akhil Goyal,
	Apeksha Gupta

In test_queue_pair_descriptor_setup() and
test_device_configure_invalid_queue_pair_ids a QAT specific
check is there, however the test case can be run on any PMD.
Hence removed the unnecessary check.

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 app/test/test_cryptodev.c | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 08a12af25..96ce01cb2 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -767,27 +767,19 @@ test_device_configure_invalid_queue_pair_ids(void)
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
 	uint16_t orig_nb_qps = ts_params->conf.nb_queue_pairs;
 
-	/* This test is for QAT and NITROX PMDs only */
-	if (gbl_driver_id != rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD)) &&
-	    gbl_driver_id != rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_NITROX_PMD)))
-		return -ENOTSUP;
-
 	/* Stop the device in case it's started so it can be configured */
 	rte_cryptodev_stop(ts_params->valid_devs[0]);
 
-	/* valid - one queue pairs */
-	ts_params->conf.nb_queue_pairs = 1;
+	/* valid - max value queue pairs */
+	ts_params->conf.nb_queue_pairs = orig_nb_qps;
 
 	TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0],
 			&ts_params->conf),
 			"Failed to configure cryptodev: dev_id %u, qp_id %u",
 			ts_params->valid_devs[0], ts_params->conf.nb_queue_pairs);
 
-
-	/* valid - max value queue pairs */
-	ts_params->conf.nb_queue_pairs = orig_nb_qps;
+	/* valid - one queue pairs */
+	ts_params->conf.nb_queue_pairs = 1;
 
 	TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0],
 			&ts_params->conf),
@@ -845,15 +837,9 @@ test_queue_pair_descriptor_setup(void)
 
 	uint16_t qp_id;
 
-	/* This test is for QAT PMD only */
-	if (gbl_driver_id != rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD)))
-		return -ENOTSUP;
-
 	/* Stop the device in case it's started so it can be configured */
 	rte_cryptodev_stop(ts_params->valid_devs[0]);
 
-
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
 	TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0],
-- 
2.17.1


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

* [dpdk-dev] [PATCH 9/9] test/crypto: remove unused variable
  2020-05-04 21:58 [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup Akhil Goyal
                   ` (7 preceding siblings ...)
  2020-05-04 21:58 ` [dpdk-dev] [PATCH 8/9] test/crypto: remove QAT specific check Akhil Goyal
@ 2020-05-04 21:58 ` Akhil Goyal
  2020-05-05 14:11 ` [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup Dybkowski, AdamX
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 32+ messages in thread
From: Akhil Goyal @ 2020-05-04 21:58 UTC (permalink / raw)
  To: dev
  Cc: Ruifeng.Wang, declan.doherty, asomalap, anoobj, roy.fan.zhang,
	fiona.trahe, tdu, rnagadheeraj, adwivedi, G.Singh,
	hemant.agrawal, jianjay.zhou, pablo.de.lara.guarch, Akhil Goyal

dev info is set but not used in
test_queue_pair_descriptor_setup().

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 app/test/test_cryptodev.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 96ce01cb2..f9de26a30 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -830,18 +830,14 @@ static int
 test_queue_pair_descriptor_setup(void)
 {
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
-	struct rte_cryptodev_info dev_info;
 	struct rte_cryptodev_qp_conf qp_conf = {
 		.nb_descriptors = MAX_NUM_OPS_INFLIGHT
 	};
-
 	uint16_t qp_id;
 
 	/* Stop the device in case it's started so it can be configured */
 	rte_cryptodev_stop(ts_params->valid_devs[0]);
 
-	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
-
 	TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0],
 			&ts_params->conf),
 			"Failed to configure cryptodev %u",
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH 1/9] cryptodev: add feature flag for non-byte aligned data
  2020-05-04 21:58 ` [dpdk-dev] [PATCH 1/9] cryptodev: add feature flag for non-byte aligned data Akhil Goyal
@ 2020-05-05  9:57   ` Trahe, Fiona
  2020-05-05 10:12     ` Akhil Goyal
  0 siblings, 1 reply; 32+ messages in thread
From: Trahe, Fiona @ 2020-05-05  9:57 UTC (permalink / raw)
  To: Akhil Goyal, dev
  Cc: Ruifeng.Wang, Doherty, Declan, asomalap, anoobj, Zhang, Roy Fan,
	tdu, rnagadheeraj, adwivedi, G.Singh, hemant.agrawal,
	jianjay.zhou, De Lara Guarch, Pablo, Trahe, Fiona

Hi Akhil,

> -----Original Message-----
> From: Akhil Goyal <akhil.goyal@nxp.com>
> Sent: Monday, May 4, 2020 10:58 PM
> To: dev@dpdk.org
> Cc: Ruifeng.Wang@arm.com; Doherty, Declan <declan.doherty@intel.com>; asomalap@amd.com;
> anoobj@marvell.com; Zhang, Roy Fan <roy.fan.zhang@intel.com>; Trahe, Fiona
> <fiona.trahe@intel.com>; tdu@semihalf.com; rnagadheeraj@marvell.com; adwivedi@marvell.com;
> G.Singh@nxp.com; hemant.agrawal@nxp.com; jianjay.zhou@huawei.com; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>; Akhil Goyal <akhil.goyal@nxp.com>
> Subject: [PATCH 1/9] cryptodev: add feature flag for non-byte aligned data
> 
> 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.
[Fiona] I know it's a bit pedantic, but shouldn't this really be called NON_BYTE_MULTIPLE?

As a non-byte-multiple data set could have its start byte-aligned, but still not be supported.


 > Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
> ---
>  doc/guides/cryptodevs/features/default.ini | 1 +
>  doc/guides/cryptodevs/features/kasumi.ini  | 1 +
>  doc/guides/cryptodevs/features/snow3g.ini  | 1 +
>  doc/guides/cryptodevs/features/zuc.ini     | 1 +
>  drivers/crypto/kasumi/rte_kasumi_pmd.c     | 1 +
>  drivers/crypto/snow3g/rte_snow3g_pmd.c     | 1 +
>  drivers/crypto/zuc/rte_zuc_pmd.c           | 1 +
>  lib/librte_cryptodev/rte_cryptodev.c       | 2 ++
>  lib/librte_cryptodev/rte_cryptodev.h       | 2 ++
>  9 files changed, 11 insertions(+)
> 
> diff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryptodevs/features/default.ini
> index 118479db5..fb1ddca71 100644
> --- a/doc/guides/cryptodevs/features/default.ini
> +++ b/doc/guides/cryptodevs/features/default.ini
> @@ -29,6 +29,7 @@ Digest encrypted       =
>  Asymmetric sessionless =
>  CPU crypto             =
>  Symmetric sessionless  =
> +Non-Byte aligned data  =
> 
>  ;
>  ; 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 99ded0401..8380a5765 100644
> --- a/doc/guides/cryptodevs/features/kasumi.ini
> +++ b/doc/guides/cryptodevs/features/kasumi.ini
> @@ -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.
> diff --git a/doc/guides/cryptodevs/features/snow3g.ini b/doc/guides/cryptodevs/features/snow3g.ini
> index 8b971cc1d..b2caefe3a 100644
> --- a/doc/guides/cryptodevs/features/snow3g.ini
> +++ b/doc/guides/cryptodevs/features/snow3g.ini
> @@ -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.
> diff --git a/doc/guides/cryptodevs/features/zuc.ini b/doc/guides/cryptodevs/features/zuc.ini
> index f7bff4291..21d074f9b 100644
> --- a/doc/guides/cryptodevs/features/zuc.ini
> +++ b/doc/guides/cryptodevs/features/zuc.ini
> @@ -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.
> diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd.c b/drivers/crypto/kasumi/rte_kasumi_pmd.c
> index a20921249..73077e3d9 100644
> --- a/drivers/crypto/kasumi/rte_kasumi_pmd.c
> +++ b/drivers/crypto/kasumi/rte_kasumi_pmd.c
> @@ -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);
> diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd.c b/drivers/crypto/snow3g/rte_snow3g_pmd.c
> index 8e82dde55..c939064d5 100644
> --- a/drivers/crypto/snow3g/rte_snow3g_pmd.c
> +++ b/drivers/crypto/snow3g/rte_snow3g_pmd.c
> @@ -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);
> diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c b/drivers/crypto/zuc/rte_zuc_pmd.c
> index 17926b471..459881873 100644
> --- a/drivers/crypto/zuc/rte_zuc_pmd.c
> +++ b/drivers/crypto/zuc/rte_zuc_pmd.c
> @@ -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);
> diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
> index 7693eb69c..f30e3cbff 100644
> --- a/lib/librte_cryptodev/rte_cryptodev.c
> +++ b/lib/librte_cryptodev/rte_cryptodev.c
> @@ -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;
>  	}
> diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h
> index 3dbb5ceb2..257840ea4 100644
> --- a/lib/librte_cryptodev/rte_cryptodev.h
> +++ b/lib/librte_cryptodev/rte_cryptodev.h
> @@ -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 */
> 
> 
>  /**
> --
> 2.17.1


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

* Re: [dpdk-dev] [PATCH 1/9] cryptodev: add feature flag for non-byte aligned data
  2020-05-05  9:57   ` Trahe, Fiona
@ 2020-05-05 10:12     ` Akhil Goyal
  2020-05-05 12:04       ` Trahe, Fiona
  0 siblings, 1 reply; 32+ messages in thread
From: Akhil Goyal @ 2020-05-05 10:12 UTC (permalink / raw)
  To: Trahe, Fiona, dev
  Cc: Ruifeng.Wang, Doherty, Declan, asomalap, anoobj, Zhang, Roy Fan,
	tdu, rnagadheeraj, adwivedi, Gagandeep Singh, Hemant Agrawal,
	jianjay.zhou, De Lara Guarch, Pablo

Hi Fiona,
> 
> Hi Akhil,
> 
> >
> > 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.
> [Fiona] I know it's a bit pedantic, but shouldn't this really be called
> NON_BYTE_MULTIPLE?
> 
> As a non-byte-multiple data set could have its start byte-aligned, but still not be
> supported.
> 
The intention is to have both start as well as end to be byte aligned.
Is there some PMD which can support unaligned byte data but still multiples of byte?
BTW I did not see any example in the current test cases which support unaligned bytes data.

Regards,
Akhil

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

* Re: [dpdk-dev] [PATCH 1/9] cryptodev: add feature flag for non-byte aligned data
  2020-05-05 10:12     ` Akhil Goyal
@ 2020-05-05 12:04       ` Trahe, Fiona
  0 siblings, 0 replies; 32+ messages in thread
From: Trahe, Fiona @ 2020-05-05 12:04 UTC (permalink / raw)
  To: Akhil Goyal, dev
  Cc: Ruifeng.Wang, Doherty, Declan, asomalap, anoobj, Zhang, Roy Fan,
	tdu, rnagadheeraj, adwivedi, Gagandeep Singh, Hemant Agrawal,
	jianjay.zhou, De Lara Guarch, Pablo, Trahe, Fiona

Hi Akhil,

> -----Original Message-----
> From: Akhil Goyal <akhil.goyal@nxp.com>
> Sent: Tuesday, May 5, 2020 11:13 AM
> To: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org
> Cc: Ruifeng.Wang@arm.com; Doherty, Declan <declan.doherty@intel.com>; asomalap@amd.com;
> anoobj@marvell.com; Zhang, Roy Fan <roy.fan.zhang@intel.com>; tdu@semihalf.com;
> rnagadheeraj@marvell.com; adwivedi@marvell.com; Gagandeep Singh <G.Singh@nxp.com>; Hemant
> Agrawal <hemant.agrawal@nxp.com>; jianjay.zhou@huawei.com; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Subject: RE: [PATCH 1/9] cryptodev: add feature flag for non-byte aligned data
> 
> Hi Fiona,
> >
> > Hi Akhil,
> >
> > >
> > > 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.
> > [Fiona] I know it's a bit pedantic, but shouldn't this really be called
> > NON_BYTE_MULTIPLE?
> >
> > As a non-byte-multiple data set could have its start byte-aligned, but still not be
> > supported.
> >
> The intention is to have both start as well as end to be byte aligned.
> Is there some PMD which can support unaligned byte data but still multiples of byte?
[Fiona] no, true - anything which can support non-byte-aligned can presumably support non-byte-multiples.
So I withdraw my suggestion. In that case:
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
 
> BTW I did not see any example in the current test cases which support unaligned bytes data.
> 
> Regards,
> Akhil

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

* Re: [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup
  2020-05-04 21:58 [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup Akhil Goyal
                   ` (8 preceding siblings ...)
  2020-05-04 21:58 ` [dpdk-dev] [PATCH 9/9] test/crypto: remove unused variable Akhil Goyal
@ 2020-05-05 14:11 ` Dybkowski, AdamX
  2020-05-08  8:55 ` Ruifeng Wang
  2020-05-09 23:12 ` [dpdk-dev] [PATCH v2 " Akhil Goyal
  11 siblings, 0 replies; 32+ messages in thread
From: Dybkowski, AdamX @ 2020-05-05 14:11 UTC (permalink / raw)
  To: Akhil Goyal, dev
  Cc: Ruifeng.Wang, Doherty, Declan, asomalap, anoobj, Zhang, Roy Fan,
	Trahe, Fiona, tdu, rnagadheeraj, adwivedi, G.Singh,
	hemant.agrawal, jianjay.zhou, De Lara Guarch, Pablo

Hi Akhil.

I checked these PMDs work properly after applying this patch series:
QAT, SW_ZUC, SW_SNOW3G, SCHEDULER, NULL

But there is a problem with OpenSSL PMD - it fails in one test now:
+ TestCase [15] : test_stats failed

As it is software-only PMD, you can verify this also on your side. Please do.

Adam Dybkowski


> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Akhil Goyal
> Sent: Monday, 4 May, 2020 23:58
> To: dev@dpdk.org
> Cc: Ruifeng.Wang@arm.com; Doherty, Declan <declan.doherty@intel.com>;
> asomalap@amd.com; anoobj@marvell.com; Zhang, Roy Fan
> <roy.fan.zhang@intel.com>; Trahe, Fiona <fiona.trahe@intel.com>;
> tdu@semihalf.com; rnagadheeraj@marvell.com; adwivedi@marvell.com;
> G.Singh@nxp.com; hemant.agrawal@nxp.com; jianjay.zhou@huawei.com;
> De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>; Akhil Goyal
> <akhil.goyal@nxp.com>
> Subject: [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup
> 
> Certain cases were put in PMD specific checks which should be avoided.
> Appropriate capability/supported feature flag should be checked before
> executing the test case.
> Added 1 missing feature flag for non-byte aligned data Enabled it for
> SNOW/ZUC/KASUMI PMDs.
> All the PMD owners are requested to verify these changes and let me know
> in case there are some issues.
> 
> Also removed PMD specific testsuite for dpaa_sec and dpaa2_sec.
> It is requested to all PMD owners to remove their PMD specific suites and
> move to generic testsuite.
> 
> Akhil Goyal (9):
>   cryptodev: add feature flag for non-byte aligned data
>   test/crypto: skip unsupported non-byte aligned cases
>   test/crypto: skip unsupported SG cases
>   test/crypto: skip unsupported sessionless cases
>   test/crypto: skip unsupported session
>   test/crypto: run PDCP cases if supported
>   test/crypto: remove dpaaX_sec specific testsuites
>   test/crypto: remove QAT specific check
>   test/crypto: remove unused variable
> 
>  app/test/test_cryptodev.c                  | 845 +++++----------------
>  doc/guides/cryptodevs/features/default.ini |   1 +
>  doc/guides/cryptodevs/features/kasumi.ini  |   1 +
>  doc/guides/cryptodevs/features/snow3g.ini  |   1 +
>  doc/guides/cryptodevs/features/zuc.ini     |   1 +
>  drivers/crypto/kasumi/rte_kasumi_pmd.c     |   1 +
>  drivers/crypto/snow3g/rte_snow3g_pmd.c     |   1 +
>  drivers/crypto/zuc/rte_zuc_pmd.c           |   1 +
>  lib/librte_cryptodev/rte_cryptodev.c       |   2 +
>  lib/librte_cryptodev/rte_cryptodev.h       |   2 +
>  10 files changed, 194 insertions(+), 662 deletions(-)
> 
> --
> 2.17.1


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

* Re: [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup
  2020-05-04 21:58 [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup Akhil Goyal
                   ` (9 preceding siblings ...)
  2020-05-05 14:11 ` [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup Dybkowski, AdamX
@ 2020-05-08  8:55 ` Ruifeng Wang
  2020-05-09 23:57   ` Akhil Goyal
  2020-05-09 23:12 ` [dpdk-dev] [PATCH v2 " Akhil Goyal
  11 siblings, 1 reply; 32+ messages in thread
From: Ruifeng Wang @ 2020-05-08  8:55 UTC (permalink / raw)
  To: Akhil.goyal@nxp.com, dev
  Cc: declan.doherty, asomalap, anoobj, roy.fan.zhang, fiona.trahe,
	tdu, rnagadheeraj, adwivedi, G.Singh, hemant.agrawal,
	jianjay.zhou, pablo.de.lara.guarch, Akhil.goyal@nxp.com, nd


> -----Original Message-----
> From: Akhil Goyal <akhil.goyal@nxp.com>
> Sent: Tuesday, May 5, 2020 5:58 AM
> To: dev@dpdk.org
> Cc: Ruifeng Wang <Ruifeng.Wang@arm.com>; declan.doherty@intel.com;
> asomalap@amd.com; anoobj@marvell.com; roy.fan.zhang@intel.com;
> fiona.trahe@intel.com; tdu@semihalf.com; rnagadheeraj@marvell.com;
> adwivedi@marvell.com; G.Singh@nxp.com; hemant.agrawal@nxp.com;
> jianjay.zhou@huawei.com; pablo.de.lara.guarch@intel.com;
> Akhil.goyal@nxp.com
> Subject: [PATCH 0/9] test/crypto: code cleanup
> 
> Certain cases were put in PMD specific checks which should be avoided.
> Appropriate capability/supported feature flag should be checked before
> executing the test case.
> Added 1 missing feature flag for non-byte aligned data Enabled it for
> SNOW/ZUC/KASUMI PMDs.
> All the PMD owners are requested to verify these changes and let me know
> in case there are some issues.
> 
> Also removed PMD specific testsuite for dpaa_sec and dpaa2_sec.
> It is requested to all PMD owners to remove their PMD specific suites and
> move to generic testsuite.
> 
> Akhil Goyal (9):
>   cryptodev: add feature flag for non-byte aligned data
>   test/crypto: skip unsupported non-byte aligned cases
>   test/crypto: skip unsupported SG cases
>   test/crypto: skip unsupported sessionless cases
>   test/crypto: skip unsupported session
>   test/crypto: run PDCP cases if supported
>   test/crypto: remove dpaaX_sec specific testsuites
>   test/crypto: remove QAT specific check
>   test/crypto: remove unused variable
> 
>  app/test/test_cryptodev.c                  | 845 +++++----------------
>  doc/guides/cryptodevs/features/default.ini |   1 +
>  doc/guides/cryptodevs/features/kasumi.ini  |   1 +
>  doc/guides/cryptodevs/features/snow3g.ini  |   1 +
>  doc/guides/cryptodevs/features/zuc.ini     |   1 +
>  drivers/crypto/kasumi/rte_kasumi_pmd.c     |   1 +
>  drivers/crypto/snow3g/rte_snow3g_pmd.c     |   1 +
>  drivers/crypto/zuc/rte_zuc_pmd.c           |   1 +
>  lib/librte_cryptodev/rte_cryptodev.c       |   2 +
>  lib/librte_cryptodev/rte_cryptodev.h       |   2 +
>  10 files changed, 194 insertions(+), 662 deletions(-)
> 
> --
> 2.17.1

Tested on armv8 platform. 
armv8 PMD and null PMD are OK.
cryptodev_openssl_autotest has a failure.

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

* [dpdk-dev] [PATCH v2 0/9] test/crypto: code cleanup
  2020-05-04 21:58 [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup Akhil Goyal
                   ` (10 preceding siblings ...)
  2020-05-08  8:55 ` Ruifeng Wang
@ 2020-05-09 23:12 ` Akhil Goyal
  2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 1/9] cryptodev: add feature flag for non-byte aligned data Akhil Goyal
                     ` (9 more replies)
  11 siblings, 10 replies; 32+ messages in thread
From: Akhil Goyal @ 2020-05-09 23:12 UTC (permalink / raw)
  To: dev
  Cc: Ruifeng.Wang, declan.doherty, asomalap, anoobj, roy.fan.zhang,
	fiona.trahe, rnagadheeraj, adwivedi, G.Singh, hemant.agrawal,
	jianjay.zhou, pablo.de.lara.guarch, adamx.dybkowski,
	apeksha.gupta, Akhil Goyal

Certain cases were put in PMD specific checks which
should be avoided. Appropriate capability/supported
feature flag should be checked before executing the
test case.
Added 1 missing feature flag for non-byte aligned data
Enabled it for SNOW/ZUC/KASUMI PMDs.
All the PMD owners are requested to verify these changes
and let me know in case there are some issues.

Also removed PMD specific testsuite for dpaa_sec and dpaa2_sec.
It is requested to all PMD owners to remove their PMD specific
suites and move to generic testsuite.

changes in v2:
patch "[8/9] test/crypto: remove QAT specific check" modified
The execution of test_queue_pair_descriptor_setup and
test_device_configure_invalid_queue_pair_ids need to be altered
as some configuration in the device gets altered in the test which
cause test_stats to fail. After shuffling the test passed on openssl
which was failing earlier. Exact root cause cannot be found.
But it is something specific to application and not driver.

Akhil Goyal (9):
  cryptodev: add feature flag for non-byte aligned data
  test/crypto: skip unsupported non-byte aligned cases
  test/crypto: skip unsupported SG cases
  test/crypto: skip unsupported sessionless cases
  test/crypto: skip unsupported session
  test/crypto: run PDCP cases if supported
  test/crypto: remove dpaaX_sec specific testsuites
  test/crypto: remove QAT specific check
  test/crypto: remove unused variable

 app/test/test_cryptodev.c                  | 893 +++++----------------
 doc/guides/cryptodevs/features/default.ini |   1 +
 doc/guides/cryptodevs/features/kasumi.ini  |   1 +
 doc/guides/cryptodevs/features/snow3g.ini  |   1 +
 doc/guides/cryptodevs/features/zuc.ini     |   1 +
 drivers/crypto/kasumi/rte_kasumi_pmd.c     |   1 +
 drivers/crypto/snow3g/rte_snow3g_pmd.c     |   1 +
 drivers/crypto/zuc/rte_zuc_pmd.c           |   1 +
 lib/librte_cryptodev/rte_cryptodev.c       |   2 +
 lib/librte_cryptodev/rte_cryptodev.h       |   2 +
 10 files changed, 218 insertions(+), 686 deletions(-)

-- 
2.17.1


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

* [dpdk-dev] [PATCH v2 1/9] cryptodev: add feature flag for non-byte aligned data
  2020-05-09 23:12 ` [dpdk-dev] [PATCH v2 " Akhil Goyal
@ 2020-05-09 23:12   ` Akhil Goyal
  2020-05-11  9:29     ` Dybkowski, AdamX
  2020-05-11  9:54     ` De Lara Guarch, Pablo
  2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 2/9] test/crypto: skip unsupported non-byte aligned cases Akhil Goyal
                     ` (8 subsequent siblings)
  9 siblings, 2 replies; 32+ messages in thread
From: Akhil Goyal @ 2020-05-09 23:12 UTC (permalink / raw)
  To: dev
  Cc: Ruifeng.Wang, declan.doherty, asomalap, anoobj, roy.fan.zhang,
	fiona.trahe, rnagadheeraj, adwivedi, G.Singh, hemant.agrawal,
	jianjay.zhou, pablo.de.lara.guarch, adamx.dybkowski,
	apeksha.gupta, Akhil Goyal

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>
---
 doc/guides/cryptodevs/features/default.ini | 1 +
 doc/guides/cryptodevs/features/kasumi.ini  | 1 +
 doc/guides/cryptodevs/features/snow3g.ini  | 1 +
 doc/guides/cryptodevs/features/zuc.ini     | 1 +
 drivers/crypto/kasumi/rte_kasumi_pmd.c     | 1 +
 drivers/crypto/snow3g/rte_snow3g_pmd.c     | 1 +
 drivers/crypto/zuc/rte_zuc_pmd.c           | 1 +
 lib/librte_cryptodev/rte_cryptodev.c       | 2 ++
 lib/librte_cryptodev/rte_cryptodev.h       | 2 ++
 9 files changed, 11 insertions(+)

diff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryptodevs/features/default.ini
index 118479db5..fb1ddca71 100644
--- a/doc/guides/cryptodevs/features/default.ini
+++ b/doc/guides/cryptodevs/features/default.ini
@@ -29,6 +29,7 @@ Digest encrypted       =
 Asymmetric sessionless =
 CPU crypto             =
 Symmetric sessionless  =
+Non-Byte aligned data  =
 
 ;
 ; 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 99ded0401..8380a5765 100644
--- a/doc/guides/cryptodevs/features/kasumi.ini
+++ b/doc/guides/cryptodevs/features/kasumi.ini
@@ -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.
diff --git a/doc/guides/cryptodevs/features/snow3g.ini b/doc/guides/cryptodevs/features/snow3g.ini
index 8b971cc1d..b2caefe3a 100644
--- a/doc/guides/cryptodevs/features/snow3g.ini
+++ b/doc/guides/cryptodevs/features/snow3g.ini
@@ -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.
diff --git a/doc/guides/cryptodevs/features/zuc.ini b/doc/guides/cryptodevs/features/zuc.ini
index f7bff4291..21d074f9b 100644
--- a/doc/guides/cryptodevs/features/zuc.ini
+++ b/doc/guides/cryptodevs/features/zuc.ini
@@ -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.
diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd.c b/drivers/crypto/kasumi/rte_kasumi_pmd.c
index a20921249..73077e3d9 100644
--- a/drivers/crypto/kasumi/rte_kasumi_pmd.c
+++ b/drivers/crypto/kasumi/rte_kasumi_pmd.c
@@ -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);
diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd.c b/drivers/crypto/snow3g/rte_snow3g_pmd.c
index 8e82dde55..c939064d5 100644
--- a/drivers/crypto/snow3g/rte_snow3g_pmd.c
+++ b/drivers/crypto/snow3g/rte_snow3g_pmd.c
@@ -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);
diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c b/drivers/crypto/zuc/rte_zuc_pmd.c
index 17926b471..459881873 100644
--- a/drivers/crypto/zuc/rte_zuc_pmd.c
+++ b/drivers/crypto/zuc/rte_zuc_pmd.c
@@ -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);
diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 7693eb69c..f30e3cbff 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -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;
 	}
diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h
index 3dbb5ceb2..257840ea4 100644
--- a/lib/librte_cryptodev/rte_cryptodev.h
+++ b/lib/librte_cryptodev/rte_cryptodev.h
@@ -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 */
 
 
 /**
-- 
2.17.1


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

* [dpdk-dev] [PATCH v2 2/9] test/crypto: skip unsupported non-byte aligned cases
  2020-05-09 23:12 ` [dpdk-dev] [PATCH v2 " Akhil Goyal
  2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 1/9] cryptodev: add feature flag for non-byte aligned data Akhil Goyal
@ 2020-05-09 23:12   ` Akhil Goyal
  2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 3/9] test/crypto: skip unsupported SG cases Akhil Goyal
                     ` (7 subsequent siblings)
  9 siblings, 0 replies; 32+ messages in thread
From: Akhil Goyal @ 2020-05-09 23:12 UTC (permalink / raw)
  To: dev
  Cc: Ruifeng.Wang, declan.doherty, asomalap, anoobj, roy.fan.zhang,
	fiona.trahe, rnagadheeraj, adwivedi, G.Singh, hemant.agrawal,
	jianjay.zhou, pablo.de.lara.guarch, adamx.dybkowski,
	apeksha.gupta, Akhil Goyal

Skipped the test cases for the PMDs which do not support
RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA and subsequently
removed the PMD specific checks for running that case.

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 app/test/test_cryptodev.c | 68 +++++++++++++++++++++++++--------------
 1 file changed, 43 insertions(+), 25 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 988e58b3a..df2c56c90 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -2461,12 +2461,16 @@ test_snow3g_authentication(const struct snow3g_hash_test_data *tdata)
 	unsigned plaintext_pad_len;
 	unsigned plaintext_len;
 	uint8_t *plaintext;
+	struct rte_cryptodev_info dev_info;
 
-	/* QAT PMD supports byte-aligned data only */
-	if ((tdata->validAuthLenInBits.len % 8 != 0) &&
-			(gbl_driver_id == rte_cryptodev_driver_id_get(
-				RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD))))
+	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+	uint64_t feat_flags = dev_info.feature_flags;
+
+	if (!(feat_flags & RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA) &&
+			((tdata->validAuthLenInBits.len % 8) != 0)) {
+		printf("Device doesn't support NON-Byte Aligned Data.\n");
 		return -ENOTSUP;
+	}
 
 	/* Verify the capabilities */
 	struct rte_cryptodev_sym_capability_idx cap_idx;
@@ -2535,12 +2539,16 @@ test_snow3g_authentication_verify(const struct snow3g_hash_test_data *tdata)
 	unsigned plaintext_pad_len;
 	unsigned plaintext_len;
 	uint8_t *plaintext;
+	struct rte_cryptodev_info dev_info;
+
+	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+	uint64_t feat_flags = dev_info.feature_flags;
 
-	/* QAT PMD supports byte-aligned data only */
-	if ((tdata->validAuthLenInBits.len % 8 != 0) &&
-			(gbl_driver_id == rte_cryptodev_driver_id_get(
-				RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD))))
+	if (!(feat_flags & RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA) &&
+			((tdata->validAuthLenInBits.len % 8) != 0)) {
+		printf("Device doesn't support NON-Byte Aligned Data.\n");
 		return -ENOTSUP;
+	}
 
 	/* Verify the capabilities */
 	struct rte_cryptodev_sym_capability_idx cap_idx;
@@ -3639,11 +3647,16 @@ test_snow3g_encryption_offset_oop(const struct snow3g_test_data *tdata)
 	uint32_t plaintext_pad_len;
 	uint8_t extra_offset = 4;
 	uint8_t *expected_ciphertext_shifted;
+	struct rte_cryptodev_info dev_info;
 
-	/* QAT PMD supports byte-aligned data only */
-	if (gbl_driver_id == rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD)))
+	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+	uint64_t feat_flags = dev_info.feature_flags;
+
+	if (!(feat_flags & RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA) &&
+			((tdata->validDataLenInBits.len % 8) != 0)) {
+		printf("Device doesn't support NON-Byte Aligned Data.\n");
 		return -ENOTSUP;
+	}
 
 	/* Verify the capabilities */
 	struct rte_cryptodev_sym_capability_idx cap_idx;
@@ -3897,8 +3910,19 @@ test_zuc_cipher_auth(const struct wireless_test_data *tdata)
 	unsigned int plaintext_pad_len;
 	unsigned int plaintext_len;
 
+	struct rte_cryptodev_info dev_info;
 	struct rte_cryptodev_sym_capability_idx cap_idx;
 
+	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+	uint64_t feat_flags = dev_info.feature_flags;
+
+	if (!(feat_flags & RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA) &&
+			((tdata->validAuthLenInBits.len % 8 != 0) ||
+			(tdata->validDataLenInBits.len % 8 != 0))) {
+		printf("Device doesn't support NON-Byte Aligned Data.\n");
+		return -ENOTSUP;
+	}
+
 	/* Check if device supports ZUC EEA3 */
 	cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_ZUC_EEA3;
@@ -5086,12 +5110,16 @@ test_zuc_authentication(const struct wireless_test_data *tdata)
 	uint8_t *plaintext;
 
 	struct rte_cryptodev_sym_capability_idx cap_idx;
+	struct rte_cryptodev_info dev_info;
 
-	/* QAT PMD supports byte-aligned data only */
-	if ((tdata->validAuthLenInBits.len % 8 != 0) &&
-			(gbl_driver_id == rte_cryptodev_driver_id_get(
-				RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD))))
+	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+	uint64_t feat_flags = dev_info.feature_flags;
+
+	if (!(feat_flags & RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA) &&
+			(tdata->validAuthLenInBits.len % 8 != 0)) {
+		printf("Device doesn't support NON-Byte Aligned Data.\n");
 		return -ENOTSUP;
+	}
 
 	/* Check if device supports ZUC EIA3 */
 	cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
@@ -6032,11 +6060,6 @@ test_zuc_hash_generate_test_case_6(void)
 static int
 test_zuc_hash_generate_test_case_7(void)
 {
-	/* This test is not for SW ZUC PMD */
-	if (gbl_driver_id == rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_ZUC_PMD)))
-		return -ENOTSUP;
-
 	return test_zuc_authentication(&zuc_test_case_auth_2080b);
 }
 
@@ -6061,11 +6084,6 @@ test_zuc_cipher_auth_test_case_2(void)
 static int
 test_zuc_auth_cipher_test_case_1(void)
 {
-	/* This test is not for SW ZUC PMD */
-	if (gbl_driver_id == rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_ZUC_PMD)))
-		return -ENOTSUP;
-
 	return test_zuc_auth_cipher(
 		&zuc_auth_cipher_test_case_1, IN_PLACE, 0);
 }
-- 
2.17.1


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

* [dpdk-dev] [PATCH v2 3/9] test/crypto: skip unsupported SG cases
  2020-05-09 23:12 ` [dpdk-dev] [PATCH v2 " Akhil Goyal
  2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 1/9] cryptodev: add feature flag for non-byte aligned data Akhil Goyal
  2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 2/9] test/crypto: skip unsupported non-byte aligned cases Akhil Goyal
@ 2020-05-09 23:12   ` Akhil Goyal
  2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 4/9] test/crypto: skip unsupported sessionless cases Akhil Goyal
                     ` (6 subsequent siblings)
  9 siblings, 0 replies; 32+ messages in thread
From: Akhil Goyal @ 2020-05-09 23:12 UTC (permalink / raw)
  To: dev
  Cc: Ruifeng.Wang, declan.doherty, asomalap, anoobj, roy.fan.zhang,
	fiona.trahe, rnagadheeraj, adwivedi, G.Singh, hemant.agrawal,
	jianjay.zhou, pablo.de.lara.guarch, adamx.dybkowski,
	apeksha.gupta, Akhil Goyal

Checked the PMD feature flag list to identify if
inplace or OOP SGLs are supported or not. If not supported
the cases are skipped.

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 app/test/test_cryptodev.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index df2c56c90..c13f8f73f 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -5212,6 +5212,19 @@ test_zuc_auth_cipher(const struct wireless_test_data *tdata,
 		printf("Device doesn't support digest encrypted.\n");
 		return -ENOTSUP;
 	}
+	if (op_mode == IN_PLACE) {
+		if (!(feat_flags & RTE_CRYPTODEV_FF_IN_PLACE_SGL)) {
+			printf("Device doesn't support in-place scatter-gather "
+					"in both input and output mbufs.\n");
+			return -ENOTSUP;
+		}
+	} else {
+		if (!(feat_flags & RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT)) {
+			printf("Device doesn't support out-of-place scatter-gather "
+					"in both input and output mbufs.\n");
+			return -ENOTSUP;
+		}
+	}
 
 	/* Create ZUC session */
 	retval = create_wireless_algo_auth_cipher_session(
-- 
2.17.1


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

* [dpdk-dev] [PATCH v2 4/9] test/crypto: skip unsupported sessionless cases
  2020-05-09 23:12 ` [dpdk-dev] [PATCH v2 " Akhil Goyal
                     ` (2 preceding siblings ...)
  2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 3/9] test/crypto: skip unsupported SG cases Akhil Goyal
@ 2020-05-09 23:12   ` Akhil Goyal
  2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 5/9] test/crypto: skip unsupported session Akhil Goyal
                     ` (5 subsequent siblings)
  9 siblings, 0 replies; 32+ messages in thread
From: Akhil Goyal @ 2020-05-09 23:12 UTC (permalink / raw)
  To: dev
  Cc: Ruifeng.Wang, declan.doherty, asomalap, anoobj, roy.fan.zhang,
	fiona.trahe, rnagadheeraj, adwivedi, G.Singh, hemant.agrawal,
	jianjay.zhou, pablo.de.lara.guarch, adamx.dybkowski,
	apeksha.gupta, Akhil Goyal

There were some PMD specific checks to skip the case if
it is not supported. This patch checks the feature flag
RTE_CRYPTODEV_FF_SYM_SESSIONLESS if PMD supports it or not.

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 app/test/test_cryptodev.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index c13f8f73f..e3df51985 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -8484,13 +8484,15 @@ test_authenticated_encryption_sessionless(
 	uint8_t *ciphertext, *auth_tag;
 	uint16_t plaintext_pad_len;
 	uint8_t key[tdata->key.len + 1];
+	struct rte_cryptodev_info dev_info;
 
-	/* This test is for AESNI MB and AESNI GCM PMDs only */
-	if ((gbl_driver_id != rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD))) &&
-			(gbl_driver_id != rte_cryptodev_driver_id_get(
-				RTE_STR(CRYPTODEV_NAME_AESNI_GCM_PMD))))
+	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+	uint64_t feat_flags = dev_info.feature_flags;
+
+	if (!(feat_flags & RTE_CRYPTODEV_FF_SYM_SESSIONLESS)) {
+		printf("Device doesn't support Sessionless ops.\n");
 		return -ENOTSUP;
+	}
 
 	/* not supported with CPU crypto */
 	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
@@ -8584,13 +8586,15 @@ test_authenticated_decryption_sessionless(
 	int retval;
 	uint8_t *plaintext;
 	uint8_t key[tdata->key.len + 1];
+	struct rte_cryptodev_info dev_info;
 
-	/* This test is for AESNI MB and AESNI GCM PMDs only */
-	if ((gbl_driver_id != rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD))) &&
-			(gbl_driver_id != rte_cryptodev_driver_id_get(
-				RTE_STR(CRYPTODEV_NAME_AESNI_GCM_PMD))))
+	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+	uint64_t feat_flags = dev_info.feature_flags;
+
+	if (!(feat_flags & RTE_CRYPTODEV_FF_SYM_SESSIONLESS)) {
+		printf("Device doesn't support Sessionless ops.\n");
 		return -ENOTSUP;
+	}
 
 	/* not supported with CPU crypto */
 	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
-- 
2.17.1


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

* [dpdk-dev] [PATCH v2 5/9] test/crypto: skip unsupported session
  2020-05-09 23:12 ` [dpdk-dev] [PATCH v2 " Akhil Goyal
                     ` (3 preceding siblings ...)
  2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 4/9] test/crypto: skip unsupported sessionless cases Akhil Goyal
@ 2020-05-09 23:12   ` Akhil Goyal
  2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 6/9] test/crypto: run PDCP cases if supported Akhil Goyal
                     ` (4 subsequent siblings)
  9 siblings, 0 replies; 32+ messages in thread
From: Akhil Goyal @ 2020-05-09 23:12 UTC (permalink / raw)
  To: dev
  Cc: Ruifeng.Wang, declan.doherty, asomalap, anoobj, roy.fan.zhang,
	fiona.trahe, rnagadheeraj, adwivedi, G.Singh, hemant.agrawal,
	jianjay.zhou, pablo.de.lara.guarch, adamx.dybkowski,
	apeksha.gupta, Akhil Goyal

The session init routine rte_cryptodev_sym_session_init(),
could return -ENOTSUP when the requested algo combination
is not supported by the PMD. This should be treated as
unsupported feature.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 app/test/test_cryptodev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index e3df51985..d86bdbf8e 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -2050,6 +2050,8 @@ create_wireless_cipher_auth_session(uint8_t dev_id,
 	status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess,
 			&ut_params->cipher_xform,
 			ts_params->session_priv_mpool);
+	if (status == -ENOTSUP)
+		return status;
 
 	TEST_ASSERT_EQUAL(status, 0, "session init failed");
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
-- 
2.17.1


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

* [dpdk-dev] [PATCH v2 6/9] test/crypto: run PDCP cases if supported
  2020-05-09 23:12 ` [dpdk-dev] [PATCH v2 " Akhil Goyal
                     ` (4 preceding siblings ...)
  2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 5/9] test/crypto: skip unsupported session Akhil Goyal
@ 2020-05-09 23:12   ` Akhil Goyal
  2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 7/9] test/crypto: remove dpaaX_sec specific testsuites Akhil Goyal
                     ` (3 subsequent siblings)
  9 siblings, 0 replies; 32+ messages in thread
From: Akhil Goyal @ 2020-05-09 23:12 UTC (permalink / raw)
  To: dev
  Cc: Ruifeng.Wang, declan.doherty, asomalap, anoobj, roy.fan.zhang,
	fiona.trahe, rnagadheeraj, adwivedi, G.Singh, hemant.agrawal,
	jianjay.zhou, pablo.de.lara.guarch, adamx.dybkowski,
	apeksha.gupta, Akhil Goyal

cryptodevs which support rte_security PDCP protocol,
can run all PDCP cases if it sets a feature flag
RTE_CRYPTODEV_FF_SECURITY. Previously, only dpaa2_sec
and dpaa_sec test suites were running these tests.
Now it is moved to generic test suite with a check
on the feature flag and the case will be skipped if it
is not supported by the PMD.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 app/test/test_cryptodev.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index d86bdbf8e..b2b215737 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -7719,6 +7719,34 @@ test_PDCP_PROTO_SGL_oop_128B_32B(void)
 			pdcp_test_data_in_len[i]+4,
 			128, 32);
 }
+
+static int
+test_PDCP_PROTO_all(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct rte_cryptodev_info dev_info;
+	int status;
+
+	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+	uint64_t feat_flags = dev_info.feature_flags;
+
+	if (!(feat_flags & RTE_CRYPTODEV_FF_SECURITY))
+		return -ENOTSUP;
+
+	status = test_PDCP_PROTO_cplane_encap_all();
+	status += test_PDCP_PROTO_cplane_decap_all();
+	status += test_PDCP_PROTO_uplane_encap_all();
+	status += test_PDCP_PROTO_uplane_decap_all();
+	status += test_PDCP_PROTO_SGL_in_place_32B();
+	status += test_PDCP_PROTO_SGL_oop_32B_128B();
+	status += test_PDCP_PROTO_SGL_oop_32B_40B();
+	status += test_PDCP_PROTO_SGL_oop_128B_32B();
+
+	if (status)
+		return TEST_FAILED;
+	else
+		return TEST_SUCCESS;
+}
 #endif
 
 static int
@@ -12379,6 +12407,10 @@ static struct unit_test_suite cryptodev_testsuite  = {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_verify_auth_aes_cmac_cipher_null_test_case_1),
 
+#ifdef RTE_LIBRTE_SECURITY
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_PDCP_PROTO_all),
+#endif
 		TEST_CASES_END() /**< NULL terminate unit test array */
 	}
 };
-- 
2.17.1


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

* [dpdk-dev] [PATCH v2 7/9] test/crypto: remove dpaaX_sec specific testsuites
  2020-05-09 23:12 ` [dpdk-dev] [PATCH v2 " Akhil Goyal
                     ` (5 preceding siblings ...)
  2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 6/9] test/crypto: run PDCP cases if supported Akhil Goyal
@ 2020-05-09 23:12   ` Akhil Goyal
  2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 8/9] test/crypto: remove QAT specific check Akhil Goyal
                     ` (2 subsequent siblings)
  9 siblings, 0 replies; 32+ messages in thread
From: Akhil Goyal @ 2020-05-09 23:12 UTC (permalink / raw)
  To: dev
  Cc: Ruifeng.Wang, declan.doherty, asomalap, anoobj, roy.fan.zhang,
	fiona.trahe, rnagadheeraj, adwivedi, G.Singh, hemant.agrawal,
	jianjay.zhou, pablo.de.lara.guarch, adamx.dybkowski,
	apeksha.gupta, Akhil Goyal

dpaa_sec and dpaa2_sec PMDs can run generic
cryptodev_testsuite. Hence removing the specific
test suites.

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 app/test/test_cryptodev.c | 534 +-------------------------------------
 1 file changed, 2 insertions(+), 532 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index b2b215737..08a12af25 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -12446,536 +12446,6 @@ static struct unit_test_suite cryptodev_caam_jr_testsuite  = {
 	}
 };
 
-static struct unit_test_suite cryptodev_dpaa_sec_testsuite  = {
-	.suite_name = "Crypto DPAA_SEC Unit Test Suite",
-	.setup = testsuite_setup,
-	.teardown = testsuite_teardown,
-	.unit_test_cases = {
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			     test_device_configure_invalid_dev_id),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			     test_multi_session),
-
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_chain_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all),
-
-#ifdef RTE_LIBRTE_SECURITY
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_cplane_encap_all),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_cplane_decap_all),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_uplane_encap_all),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_uplane_decap_all),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_SGL_in_place_32B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_SGL_oop_32B_128B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_SGL_oop_32B_40B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_SGL_oop_128B_32B),
-#endif
-		/** AES GCM Authenticated Encryption */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encrypt_SGL_in_place_1500B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encrypt_SGL_out_of_place_400B_400B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encrypt_SGL_out_of_place_1500B_2000B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encrypt_SGL_out_of_place_400B_1seg),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_7),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_8),
-
-		/** AES GCM Authenticated Decryption */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_7),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_8),
-
-		/** AES GCM Authenticated Encryption 192 bits key */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_7),
-
-		/** AES GCM Authenticated Decryption 192 bits key */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_7),
-
-		/** AES GCM Authenticated Encryption 256 bits key */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_7),
-
-		/** AES GCM Authenticated Decryption 256 bits key */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_7),
-
-		/** Out of place tests */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_oop_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_oop_test_case_1),
-
-		/** SNOW 3G encrypt only (UEA2) */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_5),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_1_oop),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-				test_snow3g_encryption_test_case_1_oop_sgl),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_1_oop),
-
-		/** SNOW 3G decrypt only (UEA2) */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_5),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_generate_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_generate_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_generate_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_verify_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_verify_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_verify_test_case_3),
-
-		/** ZUC encrypt only (EEA3) */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_encryption_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_encryption_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_encryption_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_encryption_test_case_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_encryption_test_case_5),
-
-		/** ZUC authenticate (EIA3) */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_generate_test_case_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_generate_test_case_7),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_generate_test_case_8),
-
-		/** Negative tests */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_iv_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_in_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_out_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_aad_len_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_aad_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_tag_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_iv_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_in_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_out_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_aad_len_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_aad_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_tag_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			authentication_verify_HMAC_SHA1_fail_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			authentication_verify_HMAC_SHA1_fail_tag_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			auth_decryption_AES128CBC_HMAC_SHA1_fail_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt),
-
-		/* ESN Testcase */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			auth_encrypt_AES128CBC_HMAC_SHA1_esn_check),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			auth_decrypt_AES128CBC_HMAC_SHA1_esn_check),
-
-		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
-};
-
-static struct unit_test_suite cryptodev_dpaa2_sec_testsuite  = {
-	.suite_name = "Crypto DPAA2_SEC Unit Test Suite",
-	.setup = testsuite_setup,
-	.teardown = testsuite_teardown,
-	.unit_test_cases = {
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_device_configure_invalid_dev_id),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_multi_session),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_chain_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all),
-
-#ifdef RTE_LIBRTE_SECURITY
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_cplane_encap_all),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_cplane_decap_all),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_uplane_encap_all),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_uplane_decap_all),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_SGL_in_place_32B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_SGL_oop_32B_128B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_SGL_oop_32B_40B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_PDCP_PROTO_SGL_oop_128B_32B),
-#endif
-		/** AES GCM Authenticated Encryption */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encrypt_SGL_in_place_1500B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encrypt_SGL_out_of_place_400B_400B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encrypt_SGL_out_of_place_1500B_2000B),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encrypt_SGL_out_of_place_400B_1seg),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_7),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_test_case_8),
-
-		/** AES GCM Authenticated Decryption */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_7),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_test_case_8),
-
-		/** AES GCM Authenticated Encryption 192 bits key */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_192_7),
-
-		/** AES GCM Authenticated Decryption 192 bits key */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_192_7),
-
-		/** AES GCM Authenticated Encryption 256 bits key */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_test_case_256_7),
-
-		/** AES GCM Authenticated Decryption 256 bits key */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_5),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_test_case_256_7),
-
-		/** Out of place tests */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_encryption_oop_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_authenticated_decryption_oop_test_case_1),
-
-		/** SNOW 3G encrypt only (UEA2) */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_5),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_encryption_test_case_1_oop),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-				test_snow3g_encryption_test_case_1_oop_sgl),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_1_oop),
-
-		/** SNOW 3G decrypt only (UEA2) */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_decryption_test_case_5),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_generate_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_generate_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_generate_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_verify_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_verify_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_snow3g_hash_verify_test_case_3),
-
-		/** ZUC encrypt only (EEA3) */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_encryption_test_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_encryption_test_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_encryption_test_case_3),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_encryption_test_case_4),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_encryption_test_case_5),
-
-		/** ZUC authenticate (EIA3) */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_generate_test_case_6),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_generate_test_case_7),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_zuc_hash_generate_test_case_8),
-
-		/** HMAC_MD5 Authentication */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_MD5_HMAC_generate_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_MD5_HMAC_verify_case_1),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_MD5_HMAC_generate_case_2),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_MD5_HMAC_verify_case_2),
-
-		/** Negative tests */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_iv_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_in_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_out_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_aad_len_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_aad_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_encryption_fail_tag_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_iv_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_in_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_out_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_aad_len_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_aad_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_AES_GCM_auth_decryption_fail_tag_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			authentication_verify_HMAC_SHA1_fail_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			authentication_verify_HMAC_SHA1_fail_tag_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			auth_decryption_AES128CBC_HMAC_SHA1_fail_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt),
-
-		/* ESN Testcase */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			auth_encrypt_AES128CBC_HMAC_SHA1_esn_check),
-
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			auth_decrypt_AES128CBC_HMAC_SHA1_esn_check),
-
-		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
-};
-
 static struct unit_test_suite cryptodev_armv8_testsuite  = {
 	.suite_name = "Crypto Device ARMv8 Unit Test Suite",
 	.setup = testsuite_setup,
@@ -13742,7 +13212,7 @@ test_cryptodev_dpaa2_sec(void /*argv __rte_unused, int argc __rte_unused*/)
 		return TEST_SKIPPED;
 	}
 
-	return unit_test_suite_runner(&cryptodev_dpaa2_sec_testsuite);
+	return unit_test_suite_runner(&cryptodev_testsuite);
 }
 
 static int
@@ -13758,7 +13228,7 @@ test_cryptodev_dpaa_sec(void /*argv __rte_unused, int argc __rte_unused*/)
 		return TEST_SKIPPED;
 	}
 
-	return unit_test_suite_runner(&cryptodev_dpaa_sec_testsuite);
+	return unit_test_suite_runner(&cryptodev_testsuite);
 }
 
 static int
-- 
2.17.1


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

* [dpdk-dev] [PATCH v2 8/9] test/crypto: remove QAT specific check
  2020-05-09 23:12 ` [dpdk-dev] [PATCH v2 " Akhil Goyal
                     ` (6 preceding siblings ...)
  2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 7/9] test/crypto: remove dpaaX_sec specific testsuites Akhil Goyal
@ 2020-05-09 23:12   ` Akhil Goyal
  2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 9/9] test/crypto: remove unused variable Akhil Goyal
  2020-05-11  8:39   ` [dpdk-dev] [EXT] [PATCH v2 0/9] test/crypto: code cleanup Anoob Joseph
  9 siblings, 0 replies; 32+ messages in thread
From: Akhil Goyal @ 2020-05-09 23:12 UTC (permalink / raw)
  To: dev
  Cc: Ruifeng.Wang, declan.doherty, asomalap, anoobj, roy.fan.zhang,
	fiona.trahe, rnagadheeraj, adwivedi, G.Singh, hemant.agrawal,
	jianjay.zhou, pablo.de.lara.guarch, adamx.dybkowski,
	apeksha.gupta, Akhil Goyal

In test_queue_pair_descriptor_setup() and
test_device_configure_invalid_queue_pair_ids a QAT specific
check is there, however the test case can be run on any PMD.
Hence removed the unnecessary check.

test_queue_pair_descriptor_setup and
test_device_configure_invalid_queue_pair_ids execution
need to be altered as the valid device values should be
configured in the end so that all other tests can be
executed.

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 app/test/test_cryptodev.c | 26 ++++++--------------------
 1 file changed, 6 insertions(+), 20 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 08a12af25..aa9eda5e5 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -767,27 +767,19 @@ test_device_configure_invalid_queue_pair_ids(void)
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
 	uint16_t orig_nb_qps = ts_params->conf.nb_queue_pairs;
 
-	/* This test is for QAT and NITROX PMDs only */
-	if (gbl_driver_id != rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD)) &&
-	    gbl_driver_id != rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_NITROX_PMD)))
-		return -ENOTSUP;
-
 	/* Stop the device in case it's started so it can be configured */
 	rte_cryptodev_stop(ts_params->valid_devs[0]);
 
-	/* valid - one queue pairs */
-	ts_params->conf.nb_queue_pairs = 1;
+	/* valid - max value queue pairs */
+	ts_params->conf.nb_queue_pairs = orig_nb_qps;
 
 	TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0],
 			&ts_params->conf),
 			"Failed to configure cryptodev: dev_id %u, qp_id %u",
 			ts_params->valid_devs[0], ts_params->conf.nb_queue_pairs);
 
-
-	/* valid - max value queue pairs */
-	ts_params->conf.nb_queue_pairs = orig_nb_qps;
+	/* valid - one queue pairs */
+	ts_params->conf.nb_queue_pairs = 1;
 
 	TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0],
 			&ts_params->conf),
@@ -845,15 +837,9 @@ test_queue_pair_descriptor_setup(void)
 
 	uint16_t qp_id;
 
-	/* This test is for QAT PMD only */
-	if (gbl_driver_id != rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD)))
-		return -ENOTSUP;
-
 	/* Stop the device in case it's started so it can be configured */
 	rte_cryptodev_stop(ts_params->valid_devs[0]);
 
-
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
 	TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0],
@@ -11799,10 +11785,10 @@ static struct unit_test_suite cryptodev_testsuite  = {
 	.unit_test_cases = {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 				test_device_configure_invalid_dev_id),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-				test_device_configure_invalid_queue_pair_ids),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 				test_queue_pair_descriptor_setup),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_device_configure_invalid_queue_pair_ids),
 
 		TEST_CASE_ST(ut_setup, ut_teardown,
 				test_multi_session),
-- 
2.17.1


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

* [dpdk-dev] [PATCH v2 9/9] test/crypto: remove unused variable
  2020-05-09 23:12 ` [dpdk-dev] [PATCH v2 " Akhil Goyal
                     ` (7 preceding siblings ...)
  2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 8/9] test/crypto: remove QAT specific check Akhil Goyal
@ 2020-05-09 23:12   ` Akhil Goyal
  2020-05-11  8:39   ` [dpdk-dev] [EXT] [PATCH v2 0/9] test/crypto: code cleanup Anoob Joseph
  9 siblings, 0 replies; 32+ messages in thread
From: Akhil Goyal @ 2020-05-09 23:12 UTC (permalink / raw)
  To: dev
  Cc: Ruifeng.Wang, declan.doherty, asomalap, anoobj, roy.fan.zhang,
	fiona.trahe, rnagadheeraj, adwivedi, G.Singh, hemant.agrawal,
	jianjay.zhou, pablo.de.lara.guarch, adamx.dybkowski,
	apeksha.gupta, Akhil Goyal

dev info is set but not used in
test_queue_pair_descriptor_setup().

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 app/test/test_cryptodev.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index aa9eda5e5..c624018ee 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -830,18 +830,14 @@ static int
 test_queue_pair_descriptor_setup(void)
 {
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
-	struct rte_cryptodev_info dev_info;
 	struct rte_cryptodev_qp_conf qp_conf = {
 		.nb_descriptors = MAX_NUM_OPS_INFLIGHT
 	};
-
 	uint16_t qp_id;
 
 	/* Stop the device in case it's started so it can be configured */
 	rte_cryptodev_stop(ts_params->valid_devs[0]);
 
-	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
-
 	TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0],
 			&ts_params->conf),
 			"Failed to configure cryptodev %u",
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup
  2020-05-08  8:55 ` Ruifeng Wang
@ 2020-05-09 23:57   ` Akhil Goyal
  0 siblings, 0 replies; 32+ messages in thread
From: Akhil Goyal @ 2020-05-09 23:57 UTC (permalink / raw)
  To: Ruifeng Wang, dev, Dybkowski, AdamX, anoobj
  Cc: declan.doherty, asomalap, roy.fan.zhang, fiona.trahe,
	rnagadheeraj, adwivedi, Gagandeep Singh, Hemant Agrawal,
	jianjay.zhou, pablo.de.lara.guarch, nd

Hi Ruifeng,
> 
> Tested on armv8 platform.
> armv8 PMD and null PMD are OK.
> cryptodev_openssl_autotest has a failure.

I have added a workaround to fix the openssl failure in v2. It is caused by the 8/9 patch
Of the patchset due to some dependency. I have altered the execution of two tests
And now the cases are passing on openssl. Please check.

If the workaround is not acceptable, we can skip the 8/9 patch in RC2 which is on Monday
And debug the actual cause afterwards.

Could you please Ack the other patches so that it can be applied in RC2?

Regards,
Akhil

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

* Re: [dpdk-dev] [EXT] [PATCH v2 0/9] test/crypto: code cleanup
  2020-05-09 23:12 ` [dpdk-dev] [PATCH v2 " Akhil Goyal
                     ` (8 preceding siblings ...)
  2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 9/9] test/crypto: remove unused variable Akhil Goyal
@ 2020-05-11  8:39   ` Anoob Joseph
  9 siblings, 0 replies; 32+ messages in thread
From: Anoob Joseph @ 2020-05-11  8:39 UTC (permalink / raw)
  To: Akhil Goyal, dev
  Cc: Ruifeng.Wang, declan.doherty, asomalap, roy.fan.zhang,
	fiona.trahe, Nagadheeraj Rottela, Ankur Dwivedi, G.Singh,
	hemant.agrawal, jianjay.zhou, pablo.de.lara.guarch,
	adamx.dybkowski, apeksha.gupta

Hi Akhil,

Thanks for the cleanup effort. OCTEON TX crypto PMDs would be moved to standard test framework in the next release cycle. Hope that is fine. The patches are looking good.

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

> -----Original Message-----
> From: Akhil Goyal <akhil.goyal@nxp.com>
> Sent: Sunday, May 10, 2020 4:42 AM
> To: dev@dpdk.org
> Cc: Ruifeng.Wang@arm.com; declan.doherty@intel.com; asomalap@amd.com;
> Anoob Joseph <anoobj@marvell.com>; roy.fan.zhang@intel.com;
> fiona.trahe@intel.com; Nagadheeraj Rottela <rnagadheeraj@marvell.com>;
> Ankur Dwivedi <adwivedi@marvell.com>; G.Singh@nxp.com;
> hemant.agrawal@nxp.com; jianjay.zhou@huawei.com;
> pablo.de.lara.guarch@intel.com; adamx.dybkowski@intel.com;
> apeksha.gupta@nxp.com; Akhil Goyal <akhil.goyal@nxp.com>
> Subject: [EXT] [PATCH v2 0/9] test/crypto: code cleanup
> 
> External Email
> 
> ----------------------------------------------------------------------
> Certain cases were put in PMD specific checks which should be avoided.
> Appropriate capability/supported feature flag should be checked before
> executing the test case.
> Added 1 missing feature flag for non-byte aligned data Enabled it for
> SNOW/ZUC/KASUMI PMDs.
> All the PMD owners are requested to verify these changes and let me know in
> case there are some issues.
> 
> Also removed PMD specific testsuite for dpaa_sec and dpaa2_sec.
> It is requested to all PMD owners to remove their PMD specific suites and move
> to generic testsuite.
> 
> changes in v2:
> patch "[8/9] test/crypto: remove QAT specific check" modified The execution of
> test_queue_pair_descriptor_setup and
> test_device_configure_invalid_queue_pair_ids need to be altered as some
> configuration in the device gets altered in the test which cause test_stats to fail.
> After shuffling the test passed on openssl which was failing earlier. Exact root
> cause cannot be found.
> But it is something specific to application and not driver.
> 
> Akhil Goyal (9):
>   cryptodev: add feature flag for non-byte aligned data
>   test/crypto: skip unsupported non-byte aligned cases
>   test/crypto: skip unsupported SG cases
>   test/crypto: skip unsupported sessionless cases
>   test/crypto: skip unsupported session
>   test/crypto: run PDCP cases if supported
>   test/crypto: remove dpaaX_sec specific testsuites
>   test/crypto: remove QAT specific check
>   test/crypto: remove unused variable
> 
>  app/test/test_cryptodev.c                  | 893 +++++----------------
>  doc/guides/cryptodevs/features/default.ini |   1 +
>  doc/guides/cryptodevs/features/kasumi.ini  |   1 +
>  doc/guides/cryptodevs/features/snow3g.ini  |   1 +
>  doc/guides/cryptodevs/features/zuc.ini     |   1 +
>  drivers/crypto/kasumi/rte_kasumi_pmd.c     |   1 +
>  drivers/crypto/snow3g/rte_snow3g_pmd.c     |   1 +
>  drivers/crypto/zuc/rte_zuc_pmd.c           |   1 +
>  lib/librte_cryptodev/rte_cryptodev.c       |   2 +
>  lib/librte_cryptodev/rte_cryptodev.h       |   2 +
>  10 files changed, 218 insertions(+), 686 deletions(-)
> 
> --
> 2.17.1


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

* Re: [dpdk-dev] [PATCH v2 1/9] cryptodev: add feature flag for non-byte aligned data
  2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 1/9] cryptodev: add feature flag for non-byte aligned data Akhil Goyal
@ 2020-05-11  9:29     ` Dybkowski, AdamX
  2020-05-11 10:10       ` Akhil Goyal
  2020-05-11  9:54     ` De Lara Guarch, Pablo
  1 sibling, 1 reply; 32+ messages in thread
From: Dybkowski, AdamX @ 2020-05-11  9:29 UTC (permalink / raw)
  To: Akhil Goyal, dev
  Cc: Ruifeng.Wang, Doherty, Declan, asomalap, anoobj, Zhang, Roy Fan,
	Trahe, Fiona, rnagadheeraj, adwivedi, G.Singh, hemant.agrawal,
	jianjay.zhou, De Lara Guarch, Pablo, apeksha.gupta

> -----Original Message-----
> From: Akhil Goyal <akhil.goyal@nxp.com>
> Sent: Sunday, 10 May, 2020 01:12
> To: dev@dpdk.org
> Cc: Ruifeng.Wang@arm.com; Doherty, Declan <declan.doherty@intel.com>;
> asomalap@amd.com; anoobj@marvell.com; Zhang, Roy Fan
> <roy.fan.zhang@intel.com>; Trahe, Fiona <fiona.trahe@intel.com>;
> rnagadheeraj@marvell.com; adwivedi@marvell.com; G.Singh@nxp.com;
> hemant.agrawal@nxp.com; jianjay.zhou@huawei.com; De Lara Guarch,
> Pablo <pablo.de.lara.guarch@intel.com>; Dybkowski, AdamX
> <adamx.dybkowski@intel.com>; apeksha.gupta@nxp.com; Akhil Goyal
> <akhil.goyal@nxp.com>
> Subject: [PATCH v2 1/9] cryptodev: add feature flag for non-byte aligned data
> 
> 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>
> ---

Series acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>


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

* Re: [dpdk-dev] [PATCH v2 1/9] cryptodev: add feature flag for non-byte aligned data
  2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 1/9] cryptodev: add feature flag for non-byte aligned data Akhil Goyal
  2020-05-11  9:29     ` Dybkowski, AdamX
@ 2020-05-11  9:54     ` De Lara Guarch, Pablo
  2020-05-11 10:05       ` Akhil Goyal
  1 sibling, 1 reply; 32+ messages in thread
From: De Lara Guarch, Pablo @ 2020-05-11  9:54 UTC (permalink / raw)
  To: Akhil Goyal, dev
  Cc: Ruifeng.Wang, Doherty, Declan, asomalap, anoobj, Zhang, Roy Fan,
	Trahe, Fiona, rnagadheeraj, adwivedi, G.Singh, hemant.agrawal,
	jianjay.zhou, Dybkowski, AdamX, apeksha.gupta

Hi Akhil,

> -----Original Message-----
> From: Akhil Goyal <akhil.goyal@nxp.com>
> Sent: Sunday, May 10, 2020 12:12 AM
> To: dev@dpdk.org
> Cc: Ruifeng.Wang@arm.com; Doherty, Declan <declan.doherty@intel.com>;
> asomalap@amd.com; anoobj@marvell.com; Zhang, Roy Fan
> <roy.fan.zhang@intel.com>; Trahe, Fiona <fiona.trahe@intel.com>;
> rnagadheeraj@marvell.com; adwivedi@marvell.com; G.Singh@nxp.com;
> hemant.agrawal@nxp.com; jianjay.zhou@huawei.com; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>; Dybkowski, AdamX
> <adamx.dybkowski@intel.com>; apeksha.gupta@nxp.com; Akhil Goyal
> <akhil.goyal@nxp.com>
> Subject: [PATCH v2 1/9] cryptodev: add feature flag for non-byte aligned data
> 
> 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>

On these PMDs, some of these algorithms do not support non byte aligned data.
For instance, for ZUC, the cipher algorithm doesn't support length in bits,
but the authentication algorithm does.
All test pass because in the tests we are doing encryption in bytes and then we mask off
the bits not used.
Wonder if we need two different flags for this, one for cipher and another one for authentication.
Maybe again this is not enough, since we should have a flag per algorithm... and starting with this flag is a step forward.
What do you think?

Thanks for looking into this!
Pablo


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

* Re: [dpdk-dev] [PATCH v2 1/9] cryptodev: add feature flag for non-byte aligned data
  2020-05-11  9:54     ` De Lara Guarch, Pablo
@ 2020-05-11 10:05       ` Akhil Goyal
  2020-05-11 14:40         ` De Lara Guarch, Pablo
  0 siblings, 1 reply; 32+ messages in thread
From: Akhil Goyal @ 2020-05-11 10:05 UTC (permalink / raw)
  To: De Lara Guarch, Pablo, dev
  Cc: Ruifeng.Wang, Doherty, Declan, asomalap, anoobj, Zhang, Roy Fan,
	Trahe, Fiona, rnagadheeraj, adwivedi, Gagandeep Singh,
	Hemant Agrawal, jianjay.zhou, Dybkowski, AdamX, Apeksha Gupta

Hi Pablo,
> 
> Hi Akhil,
> 
> >
> > 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>
> 
> On these PMDs, some of these algorithms do not support non byte aligned data.
> For instance, for ZUC, the cipher algorithm doesn't support length in bits,
> but the authentication algorithm does.
> All test pass because in the tests we are doing encryption in bytes and then we
> mask off
> the bits not used.
> Wonder if we need two different flags for this, one for cipher and another one
> for authentication.
> Maybe again this is not enough, since we should have a flag per algorithm... and
> starting with this flag is a step forward.
> What do you think?
IMO, supporting non-byte-aligned data is a feature as a whole, but we should not have
Per algo basis. It will be better if we come up with something in the capability as we do
For validating the key sizes etc.
We should only have a single flag in feature flag list. Or none if we have a solution which
Is generic in capability.

What do you say?

However for now I am applying this series as this is the solution that we have right now.
We can fix the ZUC issue in probably next release cycle.

Regards,
Akhil




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

* Re: [dpdk-dev] [PATCH v2 1/9] cryptodev: add feature flag for non-byte aligned data
  2020-05-11  9:29     ` Dybkowski, AdamX
@ 2020-05-11 10:10       ` Akhil Goyal
  0 siblings, 0 replies; 32+ messages in thread
From: Akhil Goyal @ 2020-05-11 10:10 UTC (permalink / raw)
  To: Dybkowski, AdamX, dev
  Cc: Ruifeng.Wang, Doherty, Declan, asomalap, anoobj, Zhang, Roy Fan,
	Trahe, Fiona, rnagadheeraj, adwivedi, Gagandeep Singh,
	Hemant Agrawal, jianjay.zhou, De Lara Guarch, Pablo,
	Apeksha Gupta

> > 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>
> > ---
> 
> Series acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>

There are a lot of other stuff which can be cleaned/optimized. I request all the PMD owners to step up
And send the patches.

Applied to dpdk-next-crypto

Thanks.

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

* Re: [dpdk-dev] [PATCH v2 1/9] cryptodev: add feature flag for non-byte aligned data
  2020-05-11 10:05       ` Akhil Goyal
@ 2020-05-11 14:40         ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 32+ messages in thread
From: De Lara Guarch, Pablo @ 2020-05-11 14:40 UTC (permalink / raw)
  To: Akhil Goyal, dev
  Cc: Ruifeng.Wang, Doherty, Declan, asomalap, anoobj, Zhang, Roy Fan,
	Trahe, Fiona, rnagadheeraj, adwivedi, Gagandeep Singh,
	Hemant Agrawal, jianjay.zhou, Dybkowski, AdamX, Apeksha Gupta

Hi Akhil,

> -----Original Message-----
> From: Akhil Goyal <akhil.goyal@nxp.com>
> Sent: Monday, May 11, 2020 11:05 AM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>; dev@dpdk.org
> Cc: Ruifeng.Wang@arm.com; Doherty, Declan <declan.doherty@intel.com>;
> asomalap@amd.com; anoobj@marvell.com; Zhang, Roy Fan
> <roy.fan.zhang@intel.com>; Trahe, Fiona <fiona.trahe@intel.com>;
> rnagadheeraj@marvell.com; adwivedi@marvell.com; Gagandeep Singh
> <G.Singh@nxp.com>; Hemant Agrawal <hemant.agrawal@nxp.com>;
> jianjay.zhou@huawei.com; Dybkowski, AdamX <adamx.dybkowski@intel.com>;
> Apeksha Gupta <apeksha.gupta@nxp.com>
> Subject: RE: [PATCH v2 1/9] cryptodev: add feature flag for non-byte aligned
> data
> 
> Hi Pablo,
> >
> > Hi Akhil,
> >
> > >
> > > 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>
> >
> > On these PMDs, some of these algorithms do not support non byte aligned
> data.
> > For instance, for ZUC, the cipher algorithm doesn't support length in
> > bits, but the authentication algorithm does.
> > All test pass because in the tests we are doing encryption in bytes
> > and then we mask off the bits not used.
> > Wonder if we need two different flags for this, one for cipher and
> > another one for authentication.
> > Maybe again this is not enough, since we should have a flag per
> > algorithm... and starting with this flag is a step forward.
> > What do you think?
> IMO, supporting non-byte-aligned data is a feature as a whole, but we should
> not have Per algo basis. It will be better if we come up with something in the
> capability as we do For validating the key sizes etc.

So in this case, it would be something per algo basis.

> We should only have a single flag in feature flag list. Or none if we have a
> solution which Is generic in capability.
> 
> What do you say?
> 
> However for now I am applying this series as this is the solution that we have
> right now.
> We can fix the ZUC issue in probably next release cycle.
> 

Agree to leave this for later releases, fixes the problem for now.

> Regards,
> Akhil
> 
> 


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

end of thread, other threads:[~2020-05-11 14:40 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-04 21:58 [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup Akhil Goyal
2020-05-04 21:58 ` [dpdk-dev] [PATCH 1/9] cryptodev: add feature flag for non-byte aligned data Akhil Goyal
2020-05-05  9:57   ` Trahe, Fiona
2020-05-05 10:12     ` Akhil Goyal
2020-05-05 12:04       ` Trahe, Fiona
2020-05-04 21:58 ` [dpdk-dev] [PATCH 2/9] test/crypto: skip unsupported non-byte aligned cases Akhil Goyal
2020-05-04 21:58 ` [dpdk-dev] [PATCH 3/9] test/crypto: skip unsupported SG cases Akhil Goyal
2020-05-04 21:58 ` [dpdk-dev] [PATCH 4/9] test/crypto: skip unsupported sessionless cases Akhil Goyal
2020-05-04 21:58 ` [dpdk-dev] [PATCH 5/9] test/crypto: skip unsupported session Akhil Goyal
2020-05-04 21:58 ` [dpdk-dev] [PATCH 6/9] test/crypto: run PDCP cases if supported Akhil Goyal
2020-05-04 21:58 ` [dpdk-dev] [PATCH 7/9] test/crypto: remove dpaaX_sec specific testsuites Akhil Goyal
2020-05-04 21:58 ` [dpdk-dev] [PATCH 8/9] test/crypto: remove QAT specific check Akhil Goyal
2020-05-04 21:58 ` [dpdk-dev] [PATCH 9/9] test/crypto: remove unused variable Akhil Goyal
2020-05-05 14:11 ` [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup Dybkowski, AdamX
2020-05-08  8:55 ` Ruifeng Wang
2020-05-09 23:57   ` Akhil Goyal
2020-05-09 23:12 ` [dpdk-dev] [PATCH v2 " Akhil Goyal
2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 1/9] cryptodev: add feature flag for non-byte aligned data Akhil Goyal
2020-05-11  9:29     ` Dybkowski, AdamX
2020-05-11 10:10       ` Akhil Goyal
2020-05-11  9:54     ` De Lara Guarch, Pablo
2020-05-11 10:05       ` Akhil Goyal
2020-05-11 14:40         ` De Lara Guarch, Pablo
2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 2/9] test/crypto: skip unsupported non-byte aligned cases Akhil Goyal
2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 3/9] test/crypto: skip unsupported SG cases Akhil Goyal
2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 4/9] test/crypto: skip unsupported sessionless cases Akhil Goyal
2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 5/9] test/crypto: skip unsupported session Akhil Goyal
2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 6/9] test/crypto: run PDCP cases if supported Akhil Goyal
2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 7/9] test/crypto: remove dpaaX_sec specific testsuites Akhil Goyal
2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 8/9] test/crypto: remove QAT specific check Akhil Goyal
2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 9/9] test/crypto: remove unused variable Akhil Goyal
2020-05-11  8:39   ` [dpdk-dev] [EXT] [PATCH v2 0/9] test/crypto: code cleanup Anoob Joseph

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