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 <pablo.de.lara.guarch@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
This commit is contained in:
Pablo de Lara 2017-03-27 12:26:02 +01:00
parent df52cb3b6e
commit b2085cce60
3 changed files with 17 additions and 11 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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,