* [dpdk-dev] [PATCH] app/test-crypto-perf: improve dequeue logic
@ 2019-03-27 11:47 Akhil Goyal
2019-03-27 11:47 ` Akhil Goyal
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Akhil Goyal @ 2019-03-27 11:47 UTC (permalink / raw)
To: dev; +Cc: declan.doherty, Akhil Goyal
In case of hardware PMDs (which may take a longer duration
for processing the packets), there may be a case when the
number of enqueued packets are more than the dequeued.
So if the difference is more than 8 times the burst size,
more dequeue operations should be performed otherwise all
the buffers will be blocked in hardware.
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
app/test-crypto-perf/cperf_test_throughput.c | 40 +++++++++++---------
1 file changed, 23 insertions(+), 17 deletions(-)
diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c
index 2767f4ea8..d24a6dda0 100644
--- a/app/test-crypto-perf/cperf_test_throughput.c
+++ b/app/test-crypto-perf/cperf_test_throughput.c
@@ -208,23 +208,29 @@ cperf_throughput_test_runner(void *test_ctx)
/* Dequeue processed burst of ops from crypto device */
- ops_deqd = rte_cryptodev_dequeue_burst(ctx->dev_id, ctx->qp_id,
- ops_processed, test_burst_size);
-
- if (likely(ops_deqd)) {
- /* Free crypto ops so they can be reused. */
- rte_mempool_put_bulk(ctx->pool,
- (void **)ops_processed, ops_deqd);
-
- ops_deqd_total += ops_deqd;
- } else {
- /**
- * Count dequeue polls which didn't return any
- * processed operations. This statistic is mainly
- * relevant to hw accelerators.
- */
- ops_deqd_failed++;
- }
+ do {
+ ops_deqd = rte_cryptodev_dequeue_burst(
+ ctx->dev_id, ctx->qp_id,
+ ops_processed, test_burst_size);
+
+ if (likely(ops_deqd)) {
+ /* Free crypto ops for reuse */
+ rte_mempool_put_bulk(ctx->pool,
+ (void **)ops_processed,
+ ops_deqd);
+
+ ops_deqd_total += ops_deqd;
+ } else {
+ /**
+ * Count dequeue polls which didn't
+ * return any processed operations.
+ * This statistic is mainly relevant
+ * to hw accelerators.
+ */
+ ops_deqd_failed++;
+ }
+ } while (ops_enqd_total - ops_deqd_total >
+ test_burst_size * 8);
}
--
2.17.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH] app/test-crypto-perf: improve dequeue logic
2019-03-27 11:47 [dpdk-dev] [PATCH] app/test-crypto-perf: improve dequeue logic Akhil Goyal
@ 2019-03-27 11:47 ` Akhil Goyal
2019-03-27 15:20 ` Zhang, Roy Fan
2019-03-27 17:31 ` Kevin Traynor
2 siblings, 0 replies; 6+ messages in thread
From: Akhil Goyal @ 2019-03-27 11:47 UTC (permalink / raw)
To: dev; +Cc: declan.doherty, Akhil Goyal
In case of hardware PMDs (which may take a longer duration
for processing the packets), there may be a case when the
number of enqueued packets are more than the dequeued.
So if the difference is more than 8 times the burst size,
more dequeue operations should be performed otherwise all
the buffers will be blocked in hardware.
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
app/test-crypto-perf/cperf_test_throughput.c | 40 +++++++++++---------
1 file changed, 23 insertions(+), 17 deletions(-)
diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c
index 2767f4ea8..d24a6dda0 100644
--- a/app/test-crypto-perf/cperf_test_throughput.c
+++ b/app/test-crypto-perf/cperf_test_throughput.c
@@ -208,23 +208,29 @@ cperf_throughput_test_runner(void *test_ctx)
/* Dequeue processed burst of ops from crypto device */
- ops_deqd = rte_cryptodev_dequeue_burst(ctx->dev_id, ctx->qp_id,
- ops_processed, test_burst_size);
-
- if (likely(ops_deqd)) {
- /* Free crypto ops so they can be reused. */
- rte_mempool_put_bulk(ctx->pool,
- (void **)ops_processed, ops_deqd);
-
- ops_deqd_total += ops_deqd;
- } else {
- /**
- * Count dequeue polls which didn't return any
- * processed operations. This statistic is mainly
- * relevant to hw accelerators.
- */
- ops_deqd_failed++;
- }
+ do {
+ ops_deqd = rte_cryptodev_dequeue_burst(
+ ctx->dev_id, ctx->qp_id,
+ ops_processed, test_burst_size);
+
+ if (likely(ops_deqd)) {
+ /* Free crypto ops for reuse */
+ rte_mempool_put_bulk(ctx->pool,
+ (void **)ops_processed,
+ ops_deqd);
+
+ ops_deqd_total += ops_deqd;
+ } else {
+ /**
+ * Count dequeue polls which didn't
+ * return any processed operations.
+ * This statistic is mainly relevant
+ * to hw accelerators.
+ */
+ ops_deqd_failed++;
+ }
+ } while (ops_enqd_total - ops_deqd_total >
+ test_burst_size * 8);
}
--
2.17.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] app/test-crypto-perf: improve dequeue logic
2019-03-27 11:47 [dpdk-dev] [PATCH] app/test-crypto-perf: improve dequeue logic Akhil Goyal
2019-03-27 11:47 ` Akhil Goyal
@ 2019-03-27 15:20 ` Zhang, Roy Fan
2019-03-27 15:20 ` Zhang, Roy Fan
2019-03-27 17:31 ` Kevin Traynor
2 siblings, 1 reply; 6+ messages in thread
From: Zhang, Roy Fan @ 2019-03-27 15:20 UTC (permalink / raw)
To: Akhil Goyal, dev; +Cc: Doherty, Declan, Trahe, Fiona, De Lara Guarch, Pablo
Hi Akhil,
This patch seems introduced performance degradation on my server with
QAT DH895XCC by more than 10% for big packets (>=256).
Fiona/Pablo, could you have a try with it?
Regards,
Fan
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Akhil Goyal
> Sent: Wednesday, March 27, 2019 11:48 AM
> To: dev@dpdk.org
> Cc: Doherty, Declan <declan.doherty@intel.com>; Akhil Goyal
> <akhil.goyal@nxp.com>
> Subject: [dpdk-dev] [PATCH] app/test-crypto-perf: improve dequeue logic
>
> In case of hardware PMDs (which may take a longer duration for processing
> the packets), there may be a case when the number of enqueued packets
> are more than the dequeued.
>
> So if the difference is more than 8 times the burst size, more dequeue
> operations should be performed otherwise all the buffers will be blocked in
> hardware.
>
> Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
> ---
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] app/test-crypto-perf: improve dequeue logic
2019-03-27 15:20 ` Zhang, Roy Fan
@ 2019-03-27 15:20 ` Zhang, Roy Fan
0 siblings, 0 replies; 6+ messages in thread
From: Zhang, Roy Fan @ 2019-03-27 15:20 UTC (permalink / raw)
To: Akhil Goyal, dev; +Cc: Doherty, Declan, Trahe, Fiona, De Lara Guarch, Pablo
Hi Akhil,
This patch seems introduced performance degradation on my server with
QAT DH895XCC by more than 10% for big packets (>=256).
Fiona/Pablo, could you have a try with it?
Regards,
Fan
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Akhil Goyal
> Sent: Wednesday, March 27, 2019 11:48 AM
> To: dev@dpdk.org
> Cc: Doherty, Declan <declan.doherty@intel.com>; Akhil Goyal
> <akhil.goyal@nxp.com>
> Subject: [dpdk-dev] [PATCH] app/test-crypto-perf: improve dequeue logic
>
> In case of hardware PMDs (which may take a longer duration for processing
> the packets), there may be a case when the number of enqueued packets
> are more than the dequeued.
>
> So if the difference is more than 8 times the burst size, more dequeue
> operations should be performed otherwise all the buffers will be blocked in
> hardware.
>
> Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
> ---
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] app/test-crypto-perf: improve dequeue logic
2019-03-27 11:47 [dpdk-dev] [PATCH] app/test-crypto-perf: improve dequeue logic Akhil Goyal
2019-03-27 11:47 ` Akhil Goyal
2019-03-27 15:20 ` Zhang, Roy Fan
@ 2019-03-27 17:31 ` Kevin Traynor
2019-03-27 17:31 ` Kevin Traynor
2 siblings, 1 reply; 6+ messages in thread
From: Kevin Traynor @ 2019-03-27 17:31 UTC (permalink / raw)
To: Akhil Goyal, dev; +Cc: declan.doherty
On 27/03/2019 11:47, Akhil Goyal wrote:
> In case of hardware PMDs (which may take a longer duration
> for processing the packets), there may be a case when the
> number of enqueued packets are more than the dequeued.
>
> So if the difference is more than 8 times the burst size,
> more dequeue operations should be performed otherwise all
> the buffers will be blocked in hardware.
>
Please add Fixes: tag and stable tag if appropriate.
> Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] app/test-crypto-perf: improve dequeue logic
2019-03-27 17:31 ` Kevin Traynor
@ 2019-03-27 17:31 ` Kevin Traynor
0 siblings, 0 replies; 6+ messages in thread
From: Kevin Traynor @ 2019-03-27 17:31 UTC (permalink / raw)
To: Akhil Goyal, dev; +Cc: declan.doherty
On 27/03/2019 11:47, Akhil Goyal wrote:
> In case of hardware PMDs (which may take a longer duration
> for processing the packets), there may be a case when the
> number of enqueued packets are more than the dequeued.
>
> So if the difference is more than 8 times the burst size,
> more dequeue operations should be performed otherwise all
> the buffers will be blocked in hardware.
>
Please add Fixes: tag and stable tag if appropriate.
> Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-03-27 17:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-27 11:47 [dpdk-dev] [PATCH] app/test-crypto-perf: improve dequeue logic Akhil Goyal
2019-03-27 11:47 ` Akhil Goyal
2019-03-27 15:20 ` Zhang, Roy Fan
2019-03-27 15:20 ` Zhang, Roy Fan
2019-03-27 17:31 ` Kevin Traynor
2019-03-27 17:31 ` Kevin Traynor
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).