patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 22.11] app/test: fix a merge problem in oop patch
@ 2025-03-31 21:32 Arkadiusz Kusztal
  2025-04-01  8:39 ` Jiang, YuX
  0 siblings, 1 reply; 3+ messages in thread
From: Arkadiusz Kusztal @ 2025-03-31 21:32 UTC (permalink / raw)
  To: stable; +Cc: kai.ji, Arkadiusz Kusztal

Fix "app/test: fix the check of the oop header data" was incorrectly
applied: code was added into the wrong functions. This fix addresses
this issue.

Bugzilla ID: 1686
Fixes: bb8feaacb489 ("test/crypto: fix check for OOP header data")

Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
---
 app/test/test_cryptodev.c | 58 +++++++++++++++++++--------------------
 1 file changed, 29 insertions(+), 29 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index ac477431c4..92113a55d2 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -11453,8 +11453,9 @@ test_authenticated_encryption_oop(const struct aead_test_data *tdata)
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
 	struct crypto_unittest_params *ut_params = &unittest_params;
 
+	uint32_t i;
 	int retval;
-	uint8_t *ciphertext, *auth_tag;
+	uint8_t *ciphertext, *auth_tag, *buffer_oop;
 	uint16_t plaintext_pad_len;
 	struct rte_cryptodev_info dev_info;
 
@@ -11526,6 +11527,18 @@ test_authenticated_encryption_oop(const struct aead_test_data *tdata)
 	debug_hexdump(stdout, "ciphertext:", ciphertext, tdata->ciphertext.len);
 	debug_hexdump(stdout, "auth tag:", auth_tag, tdata->auth_tag.len);
 
+	/* Check if the data within the offset range is not overwritten in the OOP */
+	buffer_oop = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *);
+	for (i = 0; i < ut_params->op->sym->cipher.data.offset; i++) {
+		if (buffer_oop[i]) {
+			RTE_LOG(ERR, USER1,
+				"Incorrect value of the output buffer header\n");
+			debug_hexdump(stdout, "Incorrect value:", buffer_oop,
+				ut_params->op->sym->cipher.data.offset);
+			return TEST_FAILED;
+		}
+	}
+
 	/* Validate obuf */
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
 			ciphertext,
@@ -11555,8 +11568,9 @@ test_authenticated_decryption_oop(const struct aead_test_data *tdata)
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
 	struct crypto_unittest_params *ut_params = &unittest_params;
 
+	uint32_t i;
 	int retval;
-	uint8_t *plaintext;
+	uint8_t *plaintext, *buffer_oop;
 	struct rte_cryptodev_info dev_info;
 
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
@@ -11626,6 +11640,17 @@ test_authenticated_decryption_oop(const struct aead_test_data *tdata)
 
 	debug_hexdump(stdout, "plaintext:", plaintext, tdata->ciphertext.len);
 
+	/* Check if the data within the offset range is not overwritten in the OOP */
+	buffer_oop = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *);
+	for (i = 0; i < ut_params->op->sym->cipher.data.offset; i++) {
+		if (buffer_oop[i]) {
+			RTE_LOG(ERR, USER1,
+				"Incorrect value of the output buffer header\n");
+			debug_hexdump(stdout, "Incorrect value:", buffer_oop,
+				ut_params->op->sym->cipher.data.offset);
+			return TEST_FAILED;
+		}
+	}
 	/* Validate obuf */
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
 			plaintext,
@@ -11652,9 +11677,8 @@ test_authenticated_encryption_sessionless(
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
 	struct crypto_unittest_params *ut_params = &unittest_params;
 
-	uint32_t i;
 	int retval;
-	uint8_t *ciphertext, *auth_tag, *buffer_oop;
+	uint8_t *ciphertext, *auth_tag;
 	uint16_t plaintext_pad_len;
 	uint8_t key[tdata->key.len + 1];
 	struct rte_cryptodev_info dev_info;
@@ -11722,18 +11746,6 @@ test_authenticated_encryption_sessionless(
 			ut_params->op->sym->cipher.data.offset);
 	auth_tag = ciphertext + plaintext_pad_len;
 
-	/* Check if the data within the offset range is not overwritten in the OOP */
-	buffer_oop = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *);
-	for (i = 0; i < ut_params->op->sym->cipher.data.offset; i++) {
-		if (buffer_oop[i]) {
-			RTE_LOG(ERR, USER1,
-				"Incorrect value of the output buffer header\n");
-			debug_hexdump(stdout, "Incorrect value:", buffer_oop,
-				ut_params->op->sym->cipher.data.offset);
-			return TEST_FAILED;
-		}
-	}
-
 	debug_hexdump(stdout, "ciphertext:", ciphertext, tdata->ciphertext.len);
 	debug_hexdump(stdout, "auth tag:", auth_tag, tdata->auth_tag.len);
 
@@ -11768,9 +11780,8 @@ test_authenticated_decryption_sessionless(
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
 	struct crypto_unittest_params *ut_params = &unittest_params;
 
-	uint32_t i;
 	int retval;
-	uint8_t *plaintext, *buffer_oop;
+	uint8_t *plaintext;
 	uint8_t key[tdata->key.len + 1];
 	struct rte_cryptodev_info dev_info;
 
@@ -11847,17 +11858,6 @@ test_authenticated_decryption_sessionless(
 
 	debug_hexdump(stdout, "plaintext:", plaintext, tdata->ciphertext.len);
 
-	/* Check if the data within the offset range is not overwritten in the OOP */
-	buffer_oop = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *);
-	for (i = 0; i < ut_params->op->sym->cipher.data.offset; i++) {
-		if (buffer_oop[i]) {
-			RTE_LOG(ERR, USER1,
-				"Incorrect value of the output buffer header\n");
-			debug_hexdump(stdout, "Incorrect value:", buffer_oop,
-				ut_params->op->sym->cipher.data.offset);
-			return TEST_FAILED;
-		}
-	}
 	/* Validate obuf */
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
 			plaintext,
-- 
2.43.0


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

* RE: [PATCH 22.11] app/test: fix a merge problem in oop patch
  2025-03-31 21:32 [PATCH 22.11] app/test: fix a merge problem in oop patch Arkadiusz Kusztal
@ 2025-04-01  8:39 ` Jiang, YuX
  2025-04-01 13:54   ` Luca Boccassi
  0 siblings, 1 reply; 3+ messages in thread
From: Jiang, YuX @ 2025-04-01  8:39 UTC (permalink / raw)
  To: Kusztal, ArkadiuszX, stable, Luca Boccassi
  Cc: Ji, Kai, Kusztal, ArkadiuszX, Jiang, YuX

> -----Original Message-----
> From: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
> Sent: Tuesday, April 1, 2025 5:32 AM
> To: stable@dpdk.org
> Cc: Ji, Kai <kai.ji@intel.com>; Kusztal, ArkadiuszX
> <arkadiuszx.kusztal@intel.com>
> Subject: [PATCH 22.11] app/test: fix a merge problem in oop patch
> 
> Fix "app/test: fix the check of the oop header data" was incorrectly
> applied: code was added into the wrong functions. This fix addresses this
> issue.
> 
> Bugzilla ID: 1686
> Fixes: bb8feaacb489 ("test/crypto: fix check for OOP header data")
> 
> Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
> ---
>  app/test/test_cryptodev.c | 58 +++++++++++++++++++--------------------
>  1 file changed, 29 insertions(+), 29 deletions(-)
> 
This patch can fix bug: Bugzilla ID: 1686.
Thanks all.

Tested-by: Jiang, YuX <yux.jiang@intel.com>
Best regards,
Yu Jiang

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

* Re: [PATCH 22.11] app/test: fix a merge problem in oop patch
  2025-04-01  8:39 ` Jiang, YuX
@ 2025-04-01 13:54   ` Luca Boccassi
  0 siblings, 0 replies; 3+ messages in thread
From: Luca Boccassi @ 2025-04-01 13:54 UTC (permalink / raw)
  To: Jiang, YuX; +Cc: Kusztal, ArkadiuszX, stable, Ji, Kai

On Tue, 1 Apr 2025 at 09:39, Jiang, YuX <yux.jiang@intel.com> wrote:
>
> > -----Original Message-----
> > From: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
> > Sent: Tuesday, April 1, 2025 5:32 AM
> > To: stable@dpdk.org
> > Cc: Ji, Kai <kai.ji@intel.com>; Kusztal, ArkadiuszX
> > <arkadiuszx.kusztal@intel.com>
> > Subject: [PATCH 22.11] app/test: fix a merge problem in oop patch
> >
> > Fix "app/test: fix the check of the oop header data" was incorrectly
> > applied: code was added into the wrong functions. This fix addresses this
> > issue.
> >
> > Bugzilla ID: 1686
> > Fixes: bb8feaacb489 ("test/crypto: fix check for OOP header data")
> >
> > Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
> > ---
> >  app/test/test_cryptodev.c | 58 +++++++++++++++++++--------------------
> >  1 file changed, 29 insertions(+), 29 deletions(-)
> >
> This patch can fix bug: Bugzilla ID: 1686.
> Thanks all.
>
> Tested-by: Jiang, YuX <yux.jiang@intel.com>
> Best regards,
> Yu Jiang

Thanks, applied

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

end of thread, other threads:[~2025-04-01 13:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-31 21:32 [PATCH 22.11] app/test: fix a merge problem in oop patch Arkadiusz Kusztal
2025-04-01  8:39 ` Jiang, YuX
2025-04-01 13:54   ` Luca Boccassi

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