[dpdk-dev] app/crypto-perf: fix incorrect operation free

Message ID 20170807031654.31581-1-pablo.de.lara.guarch@intel.com (mailing list archive)
State Accepted, archived
Headers

Checks

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

Commit Message

De Lara Guarch, Pablo Aug. 7, 2017, 3:16 a.m. UTC
  In crypto latency test, when some crypto operations cannot be
enqueued, they are returned to its mempool.
However, instead of freeing the operations in the array passed
to the enqueue function, the app was freeing the operations
in the array passed to the dequeue function, leading to incorrect
results.

Fixes: 15b55dd75120 ("app/crypto-perf: return crypto ops to mempool in bulk")

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

Comments

Thomas Monjalon Aug. 7, 2017, 12:31 p.m. UTC | #1
07/08/2017 05:16, Pablo de Lara:
> In crypto latency test, when some crypto operations cannot be
> enqueued, they are returned to its mempool.
> However, instead of freeing the operations in the array passed
> to the enqueue function, the app was freeing the operations
> in the array passed to the dequeue function, leading to incorrect
> results.
> 
> Fixes: 15b55dd75120 ("app/crypto-perf: return crypto ops to mempool in bulk")
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Applied, thanks
  

Patch

diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c
index 7e610d9..58b21ab 100644
--- a/app/test-crypto-perf/cperf_test_latency.c
+++ b/app/test-crypto-perf/cperf_test_latency.c
@@ -433,7 +433,7 @@  cperf_latency_test_runner(void *arg)
 			/* Free memory for not enqueued operations */
 			if (ops_enqd != burst_size)
 				rte_mempool_put_bulk(ctx->crypto_op_pool,
-						(void **)&ops_processed[ops_enqd],
+						(void **)&ops[ops_enqd],
 						burst_size - ops_enqd);
 
 			for (i = 0; i < ops_enqd; i++) {