patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Gagandeep Singh <g.singh@nxp.com>
To: gakhil@marvell.com, dev@dpdk.org
Cc: Gagandeep Singh <g.singh@nxp.com>, stable@dpdk.org
Subject: [PATCH] test/crypto: fix output buffer length
Date: Fri, 12 Nov 2021 13:23:48 +0530	[thread overview]
Message-ID: <20211112075348.930617-1-g.singh@nxp.com> (raw)

Input buffer length is getting appended with
padding length when the test case is encrypted
digest, but output buffer length is appended
with padding length for all the cases.

This patch fixes the output buffer length
by appending the padding length only when the
test case is of encrypted digest type.

Fixes: 6356c28642a6 ("test/crypto: add cases for block cipher encrypted digest")
Cc: stable@dpdk.org

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
 app/test/test_cryptodev_blockcipher.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/app/test/test_cryptodev_blockcipher.c b/app/test/test_cryptodev_blockcipher.c
index 3cdb2c96e8..5688a45377 100644
--- a/app/test/test_cryptodev_blockcipher.c
+++ b/app/test/test_cryptodev_blockcipher.c
@@ -266,7 +266,10 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 		}
 		memset(obuf->buf_addr, dst_pattern, obuf->buf_len);
 
-		buf_p = rte_pktmbuf_append(obuf, buf_len + pad_len);
+		if (t->op_mask & BLOCKCIPHER_TEST_OP_DIGEST_ENCRYPTED)
+			buf_p = rte_pktmbuf_append(obuf, buf_len + pad_len);
+		else
+			buf_p = rte_pktmbuf_append(obuf, buf_len);
 		if (!buf_p) {
 			snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "line %u "
 				"FAILED: %s", __LINE__,
-- 
2.25.1


             reply	other threads:[~2021-11-12  7:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-12  7:53 Gagandeep Singh [this message]
2021-11-16  7:26 ` [EXT] " Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211112075348.930617-1-g.singh@nxp.com \
    --to=g.singh@nxp.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).