app/crypto-perf: use rte_mempool_put_bulk
PATCH 1/1 app/crypto-perf: use rte_mempool_put_bulk
Use rte_mempool_put_bulk for both latency and throughput tests instead of rte_crypto_op_free to improve application performance.
--- app/test-crypto-perf/cperf_test_latency.c | 14 ++++++++------ app/test-crypto-perf/cperf_test_throughput.c | 8 ++++---- 2 files changed, 12 insertions(+), 10 deletions(-)
app/test-crypto-perf/cperf_test_latency.c +8 -6
@@ -393,8 +393,10 @@ cperf_latency_test_runner(void *arg) tsc_end =rte_rdtsc_precise ();/* Free memory for not enqueued operations */ -for (i = ops_enqd; i < burst_size; i++) -rte_crypto_op_free (ops[i]); +if (ops_enqd != burst_size) +rte_mempool_put_bulk (ctx->crypto_op_pool, + (void **)&ops_processed[ops_enqd], + burst_size - ops_enqd);for (i =0 ; i < ops_enqd; i++) { ctx->res[tsc_idx].tsc_start = tsc_start;
@@ -414,9 +416,9 @@ cperf_latency_test_runner(void *arg) (ops_processed[i]->opaque_data); pres->status = ops_processed[i]->status; pres->tsc_end = tsc_end; - -rte_crypto_op_free (ops_processed[i]); } +rte_mempool_put_bulk (ctx->crypto_op_pool, + (void **)ops_processed, ops_deqd); deqd_tot += ops_deqd; deqd_max =max (ops_deqd, deqd_max);
@@ -450,9 +452,9 @@ cperf_latency_test_runner(void *arg) (ops_processed[i]->opaque_data); pres->status = ops_processed[i]->status; pres->tsc_end = tsc_end; - -rte_crypto_op_free (ops_processed[i]); } +rte_mempool_put_bulk (ctx->crypto_op_pool, + (void **)ops_processed, ops_deqd); deqd_tot += ops_deqd; deqd_max =max (ops_deqd, deqd_max);
app/test-crypto-perf/cperf_test_throughput.c +4 -4
@@ -396,8 +396,8 @@ cperf_throughput_test_runner(void *test_ctx)* the crypto operation will change the data and cause * failures. */ -for (i =0 ; i < ops_deqd; i++) -rte_crypto_op_free (ops_processed[i]); +rte_mempool_put_bulk (ctx->crypto_op_pool, + (void **)ops_processed, ops_deqd); ops_deqd_total += ops_deqd; }else {
@@ -426,8 +426,8 @@ cperf_throughput_test_runner(void *test_ctx)if (ops_deqd ==0 ) ops_deqd_failed++;else { -for (i =0 ; i < ops_deqd; i++) -rte_crypto_op_free (ops_processed[i]); +rte_mempool_put_bulk (ctx->crypto_op_pool, + (void **)ops_processed, ops_deqd); ops_deqd_total += ops_deqd; }
Signature · 1 line
2.9.3
Quoted 87 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Sergio Gonzalez Monroy
Sent: Friday, June 30, 2017 8:57 AM
To: [email protected]
Cc: De Lara Guarch, Pablo <[email protected]>
Subject: [dpdk-dev] [PATCH] app/crypto-perf: userte_mempool_put_bulkUse
rte_mempool_put_bulkfor both latency and throughput tests instead ofrte_crypto_op_freeto improve application performance.Signed-off-by Sergio Gonzalez Monroy <[email protected]>--- app/test-crypto-perf/cperf_test_latency.c | 14 ++++++++------ app/test-crypto-perf/cperf_test_throughput.c | 8 ++++---- 2 files changed, 12 insertions(+), 10 deletions(-)app/test-crypto-perf/cperf_test_latency.c +8
-6@@ -393,8 +393,10 @@ cperf_latency_test_runner(void *arg) tsc_end =rte_rdtsc_precise ();/* Free memory for not enqueued operations */ -for (i = ops_enqd; i < burst_size; i++) -rte_crypto_op_free (ops[i]); +if (ops_enqd != burst_size) +rte_mempool_put_bulk (ctx->crypto_op_pool, + (void **)&ops_processed[ops_enqd], + burst_size - ops_enqd);for (i =0 ; i < ops_enqd; i++) { ctx->res[tsc_idx].tsc_start = tsc_start;@@ -414,9 +416,9 @@ cperf_latency_test_runner(void *arg) (ops_processed[i]->opaque_data); pres->status = ops_processed[i]->status; pres->tsc_end = tsc_end; - -rte_crypto_op_free (ops_processed[i]); } +rte_mempool_put_bulk (ctx->crypto_op_pool, + (void **)ops_processed, ops_deqd); deqd_tot += ops_deqd; deqd_max =max (ops_deqd, deqd_max);@@ -450,9 +452,9 @@ cperf_latency_test_runner(void *arg) (ops_processed[i]->opaque_data); pres->status = ops_processed[i]->status; pres->tsc_end = tsc_end; - -rte_crypto_op_free (ops_processed[i]); } +rte_mempool_put_bulk (ctx->crypto_op_pool, + (void **)ops_processed, ops_deqd); deqd_tot += ops_deqd; deqd_max =max (ops_deqd, deqd_max);app/test-crypto- renamed from app/test-crypto-perf/cperf_test_throughput.c +0
-0
perf/cperf_test_throughput.c
index 053dc66..85947a5 100644app/test-crypto-perf/cperf_test_throughput.c +4
-5@@ -396,8 +396,8 @@ cperf_throughput_test_runner(void *test_ctx)* the crypto operation will change the data and cause * failures. */ -for (i =0 ; i < ops_deqd; i++) -rte_crypto_op_free (ops_processed[i]); +rte_mempool_put_bulk (ctx->crypto_op_pool, + (void **)ops_processed, ops_deqd); ops_deqd_total += ops_deqd; }else {@@ -426,8 +426,8 @@ cperf_throughput_test_runner(void *test_ctx)if (ops_deqd ==0 ) ops_deqd_failed++;else { -for (i =0 ; i < ops_deqd; i++) -rte_crypto_op_free (ops_processed[i]); +rte_mempool_put_bulk (ctx->crypto_op_pool, + (void **)ops_processed, ops_deqd); ops_deqd_total += ops_deqd; } --
Quoted 1 line
2.9.3
De Lara Guarch, Pablo
AppliedQuoted 21 lines
-----Original Message-----
From: Trahe, Fiona
Sent: Friday, June 30, 2017 5:13 PM
To: Gonzalez Monroy, Sergio <[email protected]>; [email protected]
Cc: De Lara Guarch, Pablo <[email protected]>
Subject: RE: [dpdk-dev] [PATCH] app/crypto-perf: userte_mempool_put_bulkQuoted 8 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Sergio Gonzalez Monroy
Sent: Friday, June 30, 2017 8:57 AM
To: [email protected]
Cc: De Lara Guarch, Pablo <[email protected]>
Subject: [dpdk-dev] [PATCH] app/crypto-perf: userte_mempool_put_bulk
Quoted 8 lines
Quoted 1 line
Use
rte_mempool_put_bulkfor both latency and throughput testsinstead
Quoted 5 lines
of
rte_crypto_op_freeto improve application performance.Signed-off-by: Sergio Gonzalez Monroy
<[email protected]>
---Acked-by Fiona Trahe <[email protected]>
Applied to dpdk-next-crypto.
Thanks,
Pablo