[dpdk-dev] app/crypto-perf: fix AEAD tests when AAD is zero

Message ID 1491989186-159933-1-git-send-email-pablo.de.lara.guarch@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Pablo de Lara Guarch
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

De Lara Guarch, Pablo April 12, 2017, 9:26 a.m. UTC
  For AEAD algorithms, additional authenticated data (AAD)
can be passed, but it is optional, so its size can be zero.
Therefore, test can be run if no memory is allocated.

Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 app/test-crypto-perf/cperf_test_vectors.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

De Lara Guarch, Pablo April 18, 2017, 8:44 p.m. UTC | #1
> -----Original Message-----
> From: De Lara Guarch, Pablo
> Sent: Wednesday, April 12, 2017 10:26 AM
> To: dev@dpdk.org
> Cc: Doherty, Declan; stable@dpdk.org; De Lara Guarch, Pablo
> Subject: [PATCH] app/crypto-perf: fix AEAD tests when AAD is zero
> 
> For AEAD algorithms, additional authenticated data (AAD)
> can be passed, but it is optional, so its size can be zero.
> Therefore, test can be run if no memory is allocated.
> 
> Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test
> application")
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Applied to dpdk-next-crypto.

Pablo
  

Patch

diff --git a/app/test-crypto-perf/cperf_test_vectors.c b/app/test-crypto-perf/cperf_test_vectors.c
index f87bb8e..757957f 100644
--- a/app/test-crypto-perf/cperf_test_vectors.c
+++ b/app/test-crypto-perf/cperf_test_vectors.c
@@ -463,7 +463,7 @@  cperf_test_vector_get_dummy(struct cperf_options *options)
 			break;
 		}
 
-		if (aad_alloc) {
+		if (aad_alloc && options->auth_aad_sz) {
 			t_vec->aad.data = rte_malloc(NULL,
 					options->auth_aad_sz, 16);
 			if (t_vec->aad.data == NULL) {