From 7f9816b9b2589625cb4b0e98a3d770c44717d633 Mon Sep 17 00:00:00 2001 From: Archana Muniganti Date: Thu, 21 Nov 2019 16:44:27 +0530 Subject: [PATCH] app/crypto-perf: fix input of AEAD decrypt In AEAD decrypt (verify mode), test data should point to cipher text instead of plain text Fixes: 5b2b0a740fba ("app/crypto-perf: overwrite mbuf when verifying") Cc: stable@dpdk.org Signed-off-by: Archana Muniganti Acked-by: Anoob Joseph Acked-by: Akhil Goyal --- app/test-crypto-perf/cperf_test_verify.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c index bbdf37d051..833bc9a552 100644 --- a/app/test-crypto-perf/cperf_test_verify.c +++ b/app/test-crypto-perf/cperf_test_verify.c @@ -203,11 +203,19 @@ cperf_mbuf_set(struct rte_mbuf *mbuf, { uint32_t segment_sz = options->segment_sz; uint8_t *mbuf_data; - uint8_t *test_data = - (options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) ? + uint8_t *test_data; + uint32_t remaining_bytes = options->max_buffer_size; + + if (options->op_type == CPERF_AEAD) { + test_data = (options->aead_op == RTE_CRYPTO_AEAD_OP_ENCRYPT) ? test_vector->plaintext.data : test_vector->ciphertext.data; - uint32_t remaining_bytes = options->max_buffer_size; + } else { + test_data = + (options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) ? + test_vector->plaintext.data : + test_vector->ciphertext.data; + } while (remaining_bytes) { mbuf_data = rte_pktmbuf_mtod(mbuf, uint8_t *); -- 2.20.1