Skip to contentSkip to conversation

cryptodev test improvements

PATCH Applied Ciara Power 3 participants 11 messages Mar 7, 2023 – Mar 16, 2023 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

cover cryptodev test improvements

The meson driver-tests suite was missing some QAT and SW PMD crypto tests, which are now added.

Some issues were highlighted after adding to the driver-tests suite, which are also addressed in this patchset.

Ciara Power (3):
test/crypto: fix skip condition for CPU crypto SGL test/crypto: skip asym test if driver or device missing app/test: add more cryptodev tests to meson suite

 app/test/meson.build           |  5 +++++
 app/test/test_cryptodev.c      | 15 +++++++++++++--
 app/test/test_cryptodev_asym.c | 12 ++++++------
 3 files changed, 24 insertions(+), 8 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/3 test/crypto: fix skip condition for CPU crypto SGL

When SGL support was added to AESNI_MB PMD, the feature flag was enabled. This meant SGL testcases were incorrectly running for the cryptodev_cpu_aesni_mb_autotest, and SGL support was not added for CPU crypto.

Now skipping the ZUC auth cipher SGL tests for CPU crypto, and GCM authenticated encryption SGL tests for CPU crypto on AESNI_MB only, as AESNI_GCM CPU crypto supports inplace SGL.

Fixes f9dfb59edbcc ("crypto/ipsec_mb: support remaining SGL")
---
 app/test/test_cryptodev.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
app/test/test_cryptodev.c +13 -2
index aa831d79a2..b7c01a1663 100644
@@ -6537,6 +6537,9 @@ test_zuc_auth_cipher_sgl(const struct wireless_test_data *tdata,
 			tdata->digest.len) < 0)
 		return TEST_SKIPPED;
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return TEST_SKIPPED;
+
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
 	uint64_t feat_flags = dev_info.feature_flags;
@@ -7896,6 +7899,9 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata,
 		}
 	}
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return TEST_SKIPPED;
+
 	/* Create the session */
 	if (verify)
 		retval = create_wireless_algo_cipher_auth_session(
@@ -14719,8 +14725,13 @@ test_authenticated_encryption_SGL(const struct aead_test_data *tdata,
 			&cap_idx) == NULL)
 		return TEST_SKIPPED;
 
-	/* OOP not supported with CPU crypto */
-	if (oop && gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+	/*
+	 * SGL not supported on AESNI_MB PMD CPU crypto,
+	 * OOP not supported on AESNI_GCM CPU crypto
+	 */
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO &&
+			(gbl_driver_id == rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD)) || oop))
 		return TEST_SKIPPED;
 
 	/* Detailed check for the particular SGL support flag */
Signature · 1 line
2.25.1
Acked-by on v1 1/3
#2 lore raw

RE: [PATCH 1/3] test/crypto: fix skip condition for CPU crypto SGL

Quoted 22 lines

-----Original Message-----
From: Power, Ciara <[email protected]>
Sent: Tuesday, March 7, 2023 5:18 PM
To: [email protected]
Cc: Ji, Kai <[email protected]>; Power, Ciara <[email protected]>; Akhil Goyal <[email protected]>; Fan Zhang <[email protected]>
Subject: [PATCH 1/3] test/crypto: fix skip condition for CPU crypto SGL

When SGL support was added to AESNI_MB PMD, the feature flag was enabled.
This meant SGL testcases were incorrectly running for the cryptodev_cpu_aesni_mb_autotest, and SGL support was not added for CPU crypto.

Now skipping the ZUC auth cipher SGL tests for CPU crypto, and GCM authenticated encryption SGL tests for CPU crypto on AESNI_MB only, as AESNI_GCM CPU crypto supports inplace SGL.

Fixes f9dfb59edbcc ("crypto/ipsec_mb: support remaining SGL")

---> 2.25.1

#3 lore raw

PATCH 2/3 test/crypto: skip asym test if driver or device missing

In reply to Ciara Power

Asym crypto tests returned FAILED if the required driver wasn't loaded, or no suitable device was found.

This is now updated to return SKIPPED in these cases, which better reflects the status of the test, and follows the convention set in the sym crypto tests in similar circumstances.

---
 app/test/test_cryptodev_asym.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
app/test/test_cryptodev_asym.c +6 -6
index 5b16dcab56..9236817650 100644
@@ -844,7 +844,7 @@ testsuite_setup(void)
 				valid_devs, RTE_CRYPTO_MAX_DEVS);
 	if (nb_devs < 1) {
 		RTE_LOG(ERR, USER1, "No crypto devices found?\n");
-		return TEST_FAILED;
+		return TEST_SKIPPED;
 	}
 
 	/*
@@ -2256,7 +2256,7 @@ test_cryptodev_openssl_asym(void)
 
 	if (gbl_driver_id == -1) {
 		RTE_LOG(ERR, USER1, "OPENSSL PMD must be loaded.\n");
-		return TEST_FAILED;
+		return TEST_SKIPPED;
 	}
 
 	return unit_test_suite_runner(&cryptodev_openssl_asym_testsuite);
@@ -2270,7 +2270,7 @@ test_cryptodev_qat_asym(void)
 
 	if (gbl_driver_id == -1) {
 		RTE_LOG(ERR, USER1, "QAT PMD must be loaded.\n");
-		return TEST_FAILED;
+		return TEST_SKIPPED;
 	}
 
 	return unit_test_suite_runner(&cryptodev_qat_asym_testsuite);
@@ -2283,7 +2283,7 @@ test_cryptodev_octeontx_asym(void)
 			RTE_STR(CRYPTODEV_NAME_OCTEONTX_SYM_PMD));
 	if (gbl_driver_id == -1) {
 		RTE_LOG(ERR, USER1, "OCTEONTX PMD must be loaded.\n");
-		return TEST_FAILED;
+		return TEST_SKIPPED;
 	}
 	return unit_test_suite_runner(&cryptodev_octeontx_asym_testsuite);
 }
@@ -2295,7 +2295,7 @@ test_cryptodev_cn9k_asym(void)
 			RTE_STR(CRYPTODEV_NAME_CN9K_PMD));
 	if (gbl_driver_id == -1) {
 		RTE_LOG(ERR, USER1, "CN9K PMD must be loaded.\n");
-		return TEST_FAILED;
+		return TEST_SKIPPED;
 	}
 
 	/* Use test suite registered for crypto_octeontx PMD */
@@ -2309,7 +2309,7 @@ test_cryptodev_cn10k_asym(void)
 			RTE_STR(CRYPTODEV_NAME_CN10K_PMD));
 	if (gbl_driver_id == -1) {
 		RTE_LOG(ERR, USER1, "CN10K PMD must be loaded.\n");
-		return TEST_FAILED;
+		return TEST_SKIPPED;
 	}
 
 	/* Use test suite registered for crypto_octeontx PMD */
Signature · 1 line
2.25.1
#4 lore raw

PATCH 3/3 app/test: add more cryptodev tests to meson suite

In reply to Ciara Power

The meson driver-tests suite did not include some ipsec_mb SW Crypto PMD tests, and QAT tests. These are now added to avoid them being missed if the user runs tests only using the meson suite infrastructure.

---
 app/test/meson.build | 5 +++++
 1 file changed, 5 insertions(+)
app/test/meson.build +5 -0
index f34d19e3c3..8c30442b62 100644
@@ -300,13 +300,18 @@ perf_test_names = [
 driver_test_names = [
         'cryptodev_aesni_gcm_autotest',
         'cryptodev_aesni_mb_autotest',
+        'cryptodev_chacha_poly_mb_autotest',
         'cryptodev_cn10k_autotest',
         'cryptodev_cn9k_autotest',
+        'cryptodev_cpu_aesni_mb_autotest',
+        'cryptodev_cpu_aesni_gcm_autotest',
         'cryptodev_dpaa2_sec_autotest',
         'cryptodev_dpaa_sec_autotest',
         'cryptodev_null_autotest',
         'cryptodev_openssl_autotest',
         'cryptodev_qat_autotest',
+        'cryptodev_qat_asym_autotest',
+        'cryptodev_qat_raw_api_autotest',
         'cryptodev_sw_armv8_autotest',
         'cryptodev_sw_kasumi_autotest',
         'cryptodev_sw_mvsam_autotest',
Signature · 1 line
2.25.1
#5 lore raw

RE: [EXT] [PATCH 3/3] app/test: add more cryptodev tests to meson suite

Quoted 8 lines

Subject: [EXT] [PATCH 3/3] app/test: add more cryptodev tests to meson suite

The meson driver-tests suite did not include some ipsec_mb SW Crypto PMD tests, and QAT tests. These are now added to avoid them being missed if the user runs tests only using the meson suite infrastructure.

---

This patch is ok for now, but it is not scalable.
We should look for a way to consolidate all cryptodev autotests under one name.

#6 lore raw

RE: [EXT] [PATCH 3/3] app/test: add more cryptodev tests to meson suite

Hi Akhil,

Quoted 15 lines

-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Tuesday 7 March 2023 17:23
To: Power, Ciara <[email protected]>; [email protected]
Cc: Ji, Kai <[email protected]>
Subject: RE: [EXT] [PATCH 3/3] app/test: add more cryptodev tests to meson suite

Quoted 7 lines

Subject: [EXT] [PATCH 3/3] app/test: add more cryptodev tests to meson suite

The meson driver-tests suite did not include some ipsec_mb SW Crypto PMD tests, and QAT tests. These are now added to avoid them being missed if the user runs tests only using the meson suite infrastructure.

Quoted 5 lines
Quoted 2 lines

---

This patch is ok for now, but it is not scalable.
We should look for a way to consolidate all cryptodev autotests under one name.

I actually had started out to add all the missing cryptodev tests (bcmfs, caam_jr, ccp, nitrox etc.),
But the docs mention it's up to the maintainer/developer to decide whether the tests should be included in the meson test suite or not. So, because I was unaware of the reasoning behind leaving them out, I just stuck to adding QAT + ipsec_mb ones in.

I guess, if we have them all under one name, it would remove that level of granularity for which tests are added. Not sure if that is needed or not?

Thanks,
Ciara

#7 lore raw

RE: [EXT] [PATCH 3/3] app/test: add more cryptodev tests to meson suite

Hi Ciara,

Quoted 30 lines

Hi Akhil,

Quoted 15 lines

-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Tuesday 7 March 2023 17:23
To: Power, Ciara <[email protected]>; [email protected]
Cc: Ji, Kai <[email protected]>
Subject: RE: [EXT] [PATCH 3/3] app/test: add more cryptodev tests to meson suite

Quoted 7 lines

Subject: [EXT] [PATCH 3/3] app/test: add more cryptodev tests to meson suite

The meson driver-tests suite did not include some ipsec_mb SW Crypto PMD tests, and QAT tests. These are now added to avoid them being missed if the user runs tests only using the meson suite infrastructure.

Quoted 5 lines
Quoted 2 lines

---

This patch is ok for now, but it is not scalable.
We should look for a way to consolidate all cryptodev autotests under one name.

I actually had started out to add all the missing cryptodev tests (bcmfs, caam_jr, ccp, nitrox etc.),
But the docs mention it's up to the maintainer/developer to decide whether the tests should be included in the meson test suite or not.
So, because I was unaware of the reasoning behind leaving them out, I just stuck to adding QAT + ipsec_mb ones in.

Quoted 4 lines

I guess, if we have them all under one name, it would remove that level of granularity for which tests are added.
Not sure if that is needed or not?

From the past some time, we have added a lot of capability checks in the test cases So that the same case may be run on all the PMDs.

I believe it should be doable at some point going forward.
This will help in reducing the unnecessary bloating of the code.
We should put in some effort to make it similar to other device test cases. PMD specific suites are only in case of cryptodev. This should be fixed. Moreover, it would be beneficial for all the PMDs to be tested at similar levels Of granularity.

Regards,
Akhil

Acked-by on the v1 series
#8 lore raw
In reply to Ciara Power
Quoted 25 lines

-----Original Message-----
From: Power, Ciara <[email protected]>
Sent: Tuesday, March 7, 2023 5:18 PM
To: [email protected]
Cc: Ji, Kai <[email protected]>; Power, Ciara <[email protected]>
Subject: [PATCH 0/3] cryptodev test improvements

The meson driver-tests suite was missing some QAT and SW PMD crypto tests, which are now added.

Some issues were highlighted after adding to the driver-tests suite, which are also addressed in this patchset.

Ciara Power (3):
test/crypto: fix skip condition for CPU crypto SGL test/crypto: skip asym test if driver or device missing app/test: add more cryptodev tests to meson suite

 app/test/meson.build           |  5 +++++
 app/test/test_cryptodev.c      | 15 +++++++++++++--
 app/test/test_cryptodev_asym.c | 12 ++++++------
 3 files changed, 24 insertions(+), 8 deletions(-)

--
2.25.1

Applied
#9 lore raw
Quoted 9 lines
Quoted 7 lines

Subject: [PATCH 0/3] cryptodev test improvements

The meson driver-tests suite was missing some QAT and SW PMD crypto tests, which are now added.

Some issues were highlighted after adding to the driver-tests suite, which are also addressed in this patchset.

Applied to dpdk-next-crypto

Thanks

#10 lore raw
In reply to Ciara Power
Quoted 25 lines

-----Original Message-----
From: Power, Ciara <[email protected]>
Sent: Tuesday, March 7, 2023 5:18 PM
To: [email protected]
Cc: Ji, Kai <[email protected]>; Power, Ciara <[email protected]>
Subject: [PATCH 0/3] cryptodev test improvements

The meson driver-tests suite was missing some QAT and SW PMD crypto tests, which are now added.

Some issues were highlighted after adding to the driver-tests suite, which are also addressed in this patchset.

Ciara Power (3):
test/crypto: fix skip condition for CPU crypto SGL test/crypto: skip asym test if driver or device missing app/test: add more cryptodev tests to meson suite

 app/test/meson.build           |  5 +++++
 app/test/test_cryptodev.c      | 15 +++++++++++++--
 app/test/test_cryptodev_asym.c | 12 ++++++------
 3 files changed, 24 insertions(+), 8 deletions(-)

--
2.25.1