patch 'test/crypto: fix data lengths' has been queued to stable release 19.11.11

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Tue Nov 30 17:35:47 CET 2021


Hi,

FYI, your patch has been queued to stable release 19.11.11

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before December 10th 2021. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/3cf7745c4f1358b2fde4a1be7ddd61293945d786

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 3cf7745c4f1358b2fde4a1be7ddd61293945d786 Mon Sep 17 00:00:00 2001
From: Kai Ji <kai.ji at intel.com>
Date: Tue, 9 Nov 2021 10:42:31 +0000
Subject: [PATCH] test/crypto: fix data lengths

[ upstream commit f52b75c61b7cf75e5c9a665e465dfbace2a18f30 ]

This patch fixes incorrect data lengths computation in cryptodev
unit test. Previously some data lengths were incorrectly set, which
was insensitive for crypto op unit tets but is critical for raw data
path API unit tests. The patch addressed the issue by setting the
correct data lengths for some tests.

Fixes: 681f540da52b ("cryptodev: do not use AAD in wireless algorithms")
Fixes: e847fc512817 ("test/crypto: add encrypted digest case for AES-CTR-CMAC")
Fixes: b1c1df46878d ("test/crypto: add ZUC test cases for auth-cipher")

Signed-off-by: Kai Ji <kai.ji at intel.com>
Acked-by: Anoob Joseph <anoobj at marvell.com>
---
 app/test/test_cryptodev.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 89cd53e746..189f7be4a4 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -3957,9 +3957,9 @@ test_kasumi_decryption(const struct kasumi_test_data *tdata)
 
 	/* Create KASUMI operation */
 	retval = create_wireless_algo_cipher_operation(tdata->cipher_iv.data,
-					tdata->cipher_iv.len,
-					tdata->ciphertext.len,
-					tdata->validCipherOffsetInBits.len);
+			tdata->cipher_iv.len,
+			RTE_ALIGN_CEIL(tdata->validCipherLenInBits.len, 8),
+			tdata->validCipherOffsetInBits.len);
 	if (retval < 0)
 		return retval;
 
@@ -5717,20 +5717,20 @@ test_zuc_auth_cipher(const struct wireless_test_data *tdata,
 		ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf,
 					ciphertext_pad_len);
 		memcpy(ciphertext, tdata->ciphertext.data, ciphertext_len);
-		if (op_mode == OUT_OF_PLACE)
-			rte_pktmbuf_append(ut_params->obuf, ciphertext_pad_len);
 		debug_hexdump(stdout, "ciphertext:", ciphertext,
 			ciphertext_len);
 	} else {
+		/* make sure enough space to cover partial digest verify case */
 		plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf,
-					plaintext_pad_len);
+					ciphertext_pad_len);
 		memcpy(plaintext, tdata->plaintext.data, plaintext_len);
-		if (op_mode == OUT_OF_PLACE)
-			rte_pktmbuf_append(ut_params->obuf, plaintext_pad_len);
 		debug_hexdump(stdout, "plaintext:", plaintext,
 			plaintext_len);
 	}
 
+	if (op_mode == OUT_OF_PLACE)
+		rte_pktmbuf_append(ut_params->obuf, ciphertext_pad_len);
+
 	/* Create ZUC operation */
 	retval = create_wireless_algo_auth_cipher_operation(
 		tdata->digest.data, tdata->digest.len,
@@ -6704,19 +6704,19 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata,
 		ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf,
 				ciphertext_pad_len);
 		memcpy(ciphertext, tdata->ciphertext.data, ciphertext_len);
-		if (op_mode == OUT_OF_PLACE)
-			rte_pktmbuf_append(ut_params->obuf, ciphertext_pad_len);
 		debug_hexdump(stdout, "ciphertext:", ciphertext,
 				ciphertext_len);
 	} else {
+		/* make sure enough space to cover partial digest verify case */
 		plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf,
-				plaintext_pad_len);
+				ciphertext_pad_len);
 		memcpy(plaintext, tdata->plaintext.data, plaintext_len);
-		if (op_mode == OUT_OF_PLACE)
-			rte_pktmbuf_append(ut_params->obuf, plaintext_pad_len);
 		debug_hexdump(stdout, "plaintext:", plaintext, plaintext_len);
 	}
 
+	if (op_mode == OUT_OF_PLACE)
+		rte_pktmbuf_append(ut_params->obuf, ciphertext_pad_len);
+
 	/* Create the operation */
 	retval = create_wireless_algo_auth_cipher_operation(
 			tdata->digest_enc.data, tdata->digest_enc.len,
-- 
2.34.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-30 16:50:14.159082996 +0100
+++ 0143-test-crypto-fix-data-lengths.patch	2021-11-30 16:50:06.022875232 +0100
@@ -1 +1 @@
-From f52b75c61b7cf75e5c9a665e465dfbace2a18f30 Mon Sep 17 00:00:00 2001
+From 3cf7745c4f1358b2fde4a1be7ddd61293945d786 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f52b75c61b7cf75e5c9a665e465dfbace2a18f30 ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org
@@ -24 +25 @@
-index 1b68d7c43b..29e8675e30 100644
+index 89cd53e746..189f7be4a4 100644
@@ -27 +28 @@
-@@ -4102,9 +4102,9 @@ test_kasumi_decryption(const struct kasumi_test_data *tdata)
+@@ -3957,9 +3957,9 @@ test_kasumi_decryption(const struct kasumi_test_data *tdata)
@@ -40 +41 @@
-@@ -6332,20 +6332,20 @@ test_zuc_auth_cipher(const struct wireless_test_data *tdata,
+@@ -5717,20 +5717,20 @@ test_zuc_auth_cipher(const struct wireless_test_data *tdata,
@@ -66 +67 @@
-@@ -7400,19 +7400,19 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata,
+@@ -6704,19 +6704,19 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata,


More information about the stable mailing list