From: "Trahe, Fiona" <fiona.trahe@intel.com>
To: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>
Cc: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
Subject: Re: [dpdk-dev] [PATCH] app/crypto-perf: use rte_mempool_put_bulk
Date: Fri, 30 Jun 2017 16:13:27 +0000 [thread overview]
Message-ID: <348A99DA5F5B7549AA880327E580B43589227DF4@IRSMSX101.ger.corp.intel.com> (raw)
In-Reply-To: <20170630075658.45786-1-sergio.gonzalez.monroy@intel.com>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Sergio Gonzalez Monroy
> Sent: Friday, June 30, 2017 8:57 AM
> To: dev@dpdk.org
> Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Subject: [dpdk-dev] [PATCH] 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.
>
> Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
> ---
> 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(-)
>
> diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c
> index 0c85ac8..4fb7a9a 100644
> --- a/app/test-crypto-perf/cperf_test_latency.c
> +++ b/app/test-crypto-perf/cperf_test_latency.c
> @@ -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);
> diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-
> perf/cperf_test_throughput.c
> index 053dc66..85947a5 100644
> --- a/app/test-crypto-perf/cperf_test_throughput.c
> +++ b/app/test-crypto-perf/cperf_test_throughput.c
> @@ -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;
> }
> --
> 2.9.3
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
next prev parent reply other threads:[~2017-06-30 16:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-30 7:56 Sergio Gonzalez Monroy
2017-06-30 16:13 ` Trahe, Fiona [this message]
2017-07-02 11:06 ` De Lara Guarch, Pablo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=348A99DA5F5B7549AA880327E580B43589227DF4@IRSMSX101.ger.corp.intel.com \
--to=fiona.trahe@intel.com \
--cc=dev@dpdk.org \
--cc=pablo.de.lara.guarch@intel.com \
--cc=sergio.gonzalez.monroy@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).