From b2085cce60c309ba39e771b391a813ad7faea8ae Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Mon, 27 Mar 2017 12:26:02 +0100 Subject: [PATCH] app/crypto-perf: do not append digest if not used When testing cipher only operations, there is no need to append digest at the end of the buffer. Signed-off-by: Pablo de Lara Acked-by: Sergio Gonzalez Monroy --- app/test-crypto-perf/cperf_test_latency.c | 8 +++++--- app/test-crypto-perf/cperf_test_throughput.c | 10 ++++++---- app/test-crypto-perf/cperf_test_verify.c | 10 ++++++---- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c index c5273b1fdd..657d0772a8 100644 --- a/app/test-crypto-perf/cperf_test_latency.c +++ b/app/test-crypto-perf/cperf_test_latency.c @@ -182,10 +182,12 @@ cperf_mbuf_create(struct rte_mempool *mempool, memcpy(mbuf_data, test_data, last_sz); } - mbuf_data = (uint8_t *)rte_pktmbuf_append(mbuf, + if (options->op_type != CPERF_CIPHER_ONLY) { + mbuf_data = (uint8_t *)rte_pktmbuf_append(mbuf, options->auth_digest_sz); - if (mbuf_data == NULL) - goto error; + if (mbuf_data == NULL) + goto error; + } if (options->op_type == CPERF_AEAD) { uint8_t *aead = (uint8_t *)rte_pktmbuf_prepend(mbuf, diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c index 92176d7119..710807531d 100644 --- a/app/test-crypto-perf/cperf_test_throughput.c +++ b/app/test-crypto-perf/cperf_test_throughput.c @@ -163,10 +163,12 @@ cperf_mbuf_create(struct rte_mempool *mempool, memcpy(mbuf_data, test_data, last_sz); } - mbuf_data = (uint8_t *)rte_pktmbuf_append(mbuf, - options->auth_digest_sz); - if (mbuf_data == NULL) - goto error; + if (options->op_type != CPERF_CIPHER_ONLY) { + mbuf_data = (uint8_t *)rte_pktmbuf_append(mbuf, + options->auth_digest_sz); + if (mbuf_data == NULL) + goto error; + } if (options->op_type == CPERF_AEAD) { uint8_t *aead = (uint8_t *)rte_pktmbuf_prepend(mbuf, diff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c index 27fbd6cfa6..be157e63b0 100644 --- a/app/test-crypto-perf/cperf_test_verify.c +++ b/app/test-crypto-perf/cperf_test_verify.c @@ -165,10 +165,12 @@ cperf_mbuf_create(struct rte_mempool *mempool, memcpy(mbuf_data, test_data, last_sz); } - mbuf_data = (uint8_t *)rte_pktmbuf_append(mbuf, - options->auth_digest_sz); - if (mbuf_data == NULL) - goto error; + if (options->op_type != CPERF_CIPHER_ONLY) { + mbuf_data = (uint8_t *)rte_pktmbuf_append(mbuf, + options->auth_digest_sz); + if (mbuf_data == NULL) + goto error; + } if (options->op_type == CPERF_AEAD) { uint8_t *aead = (uint8_t *)rte_pktmbuf_prepend(mbuf, -- 2.20.1