DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/crypto-perf: fix invalid latency for QAT PMD
@ 2017-02-16 15:51 Slawomir Mrozowicz
  2017-03-06 16:29 ` De Lara Guarch, Pablo
  0 siblings, 1 reply; 4+ messages in thread
From: Slawomir Mrozowicz @ 2017-02-16 15:51 UTC (permalink / raw)
  To: declan.doherty; +Cc: dev, Slawomir Mrozowicz

Fixes invalid latency result when using the performance application and
hardware QAT PMD. It occurred when the number of processed packets was
higher then the size of the internal QAT PMD ring buffer and the buffer
was overflowed.
Fixed by correcting the registration of the enqueued packets and freeing
memory space for not enqueued packets.

Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
---
 app/test-crypto-perf/cperf_test_latency.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c
index 5ec1b2c..239a8e5 100644
--- a/app/test-crypto-perf/cperf_test_latency.c
+++ b/app/test-crypto-perf/cperf_test_latency.c
@@ -424,7 +424,6 @@ cperf_latency_test_runner(void *arg)
 	struct rte_crypto_op *ops[ctx->options->burst_sz];
 	struct rte_crypto_op *ops_processed[ctx->options->burst_sz];
 	uint64_t ops_enqd = 0, ops_deqd = 0;
-	uint16_t ops_unused = 0;
 	uint64_t m_idx = 0, b_idx = 0, i;
 
 	uint64_t tsc_val, tsc_end, tsc_start;
@@ -460,19 +459,18 @@ cperf_latency_test_runner(void *arg)
 						ctx->options->burst_sz :
 						ctx->options->total_ops -
 						enqd_tot;
-		uint16_t ops_needed = burst_size - ops_unused;
 
 		/* Allocate crypto ops from pool */
-		if (ops_needed != rte_crypto_op_bulk_alloc(
+		if (burst_size != rte_crypto_op_bulk_alloc(
 				ctx->crypto_op_pool,
 				RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-				ops, ops_needed))
+				ops, burst_size))
 			return -1;
 
 		/* Setup crypto op, attach mbuf etc */
 		(ctx->populate_ops)(ops, &ctx->mbufs_in[m_idx],
 				&ctx->mbufs_out[m_idx],
-				ops_needed, ctx->sess, ctx->options,
+				burst_size, ctx->sess, ctx->options,
 				ctx->test_vector);
 
 		tsc_start = rte_rdtsc_precise();
@@ -498,17 +496,15 @@ cperf_latency_test_runner(void *arg)
 
 		tsc_end = rte_rdtsc_precise();
 
-		for (i = 0; i < ops_needed; i++) {
+		for (i = 0; i < ops_enqd; i++) {
 			ctx->res[tsc_idx].tsc_start = tsc_start;
 			ops[i]->opaque_data = (void *)&ctx->res[tsc_idx];
 			tsc_idx++;
 		}
 
-		/*
-		 * Calculate number of ops not enqueued (mainly for hw
-		 * accelerators whose ingress queue can fill up).
-		 */
-		ops_unused = burst_size - ops_enqd;
+		/* Free memory for not enqueued operations */
+		for (i = ops_enqd; i < burst_size; i++)
+			rte_crypto_op_free(ops[i]);
 
 		if (likely(ops_deqd))  {
 			/*
@@ -535,7 +531,7 @@ cperf_latency_test_runner(void *arg)
 		enqd_max = max(ops_enqd, enqd_max);
 		enqd_min = min(ops_enqd, enqd_min);
 
-		m_idx += ops_needed;
+		m_idx += ops_enqd;
 		m_idx = m_idx + ctx->options->burst_sz > ctx->options->pool_sz ?
 				0 : m_idx;
 		b_idx++;
-- 
2.5.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] app/crypto-perf: fix invalid latency for QAT PMD
  2017-02-16 15:51 [dpdk-dev] [PATCH] app/crypto-perf: fix invalid latency for QAT PMD Slawomir Mrozowicz
@ 2017-03-06 16:29 ` De Lara Guarch, Pablo
  2017-03-09 21:25   ` De Lara Guarch, Pablo
  0 siblings, 1 reply; 4+ messages in thread
From: De Lara Guarch, Pablo @ 2017-03-06 16:29 UTC (permalink / raw)
  To: Mrozowicz, SlawomirX, Doherty, Declan; +Cc: dev, Mrozowicz, SlawomirX



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Slawomir
> Mrozowicz
> Sent: Thursday, February 16, 2017 3:51 PM
> To: Doherty, Declan
> Cc: dev@dpdk.org; Mrozowicz, SlawomirX
> Subject: [dpdk-dev] [PATCH] app/crypto-perf: fix invalid latency for QAT
> PMD
> 
> Fixes invalid latency result when using the performance application and
> hardware QAT PMD. It occurred when the number of processed packets was
> higher then the size of the internal QAT PMD ring buffer and the buffer
> was overflowed.
> Fixed by correcting the registration of the enqueued packets and freeing
> memory space for not enqueued packets.
> 
> Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test
> application")
> 
> Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] app/crypto-perf: fix invalid latency for QAT PMD
  2017-03-06 16:29 ` De Lara Guarch, Pablo
@ 2017-03-09 21:25   ` De Lara Guarch, Pablo
  2017-03-09 21:45     ` De Lara Guarch, Pablo
  0 siblings, 1 reply; 4+ messages in thread
From: De Lara Guarch, Pablo @ 2017-03-09 21:25 UTC (permalink / raw)
  To: De Lara Guarch, Pablo, Mrozowicz, SlawomirX, Doherty, Declan
  Cc: dev, Mrozowicz, SlawomirX



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of De Lara Guarch,
> Pablo
> Sent: Monday, March 06, 2017 4:29 PM
> To: Mrozowicz, SlawomirX; Doherty, Declan
> Cc: dev@dpdk.org; Mrozowicz, SlawomirX
> Subject: Re: [dpdk-dev] [PATCH] app/crypto-perf: fix invalid latency for QAT
> PMD
> 
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Slawomir
> > Mrozowicz
> > Sent: Thursday, February 16, 2017 3:51 PM
> > To: Doherty, Declan
> > Cc: dev@dpdk.org; Mrozowicz, SlawomirX
> > Subject: [dpdk-dev] [PATCH] app/crypto-perf: fix invalid latency for QAT
> > PMD
> >
> > Fixes invalid latency result when using the performance application and
> > hardware QAT PMD. It occurred when the number of processed packets
> was
> > higher then the size of the internal QAT PMD ring buffer and the buffer
> > was overflowed.
> > Fixed by correcting the registration of the enqueued packets and freeing
> > memory space for not enqueued packets.
> >
> > Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test
> > application")
> >
> > Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
> 
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Applied to dpdk-next-crypto.
Thanks,

Pablo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] app/crypto-perf: fix invalid latency for QAT PMD
  2017-03-09 21:25   ` De Lara Guarch, Pablo
@ 2017-03-09 21:45     ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 4+ messages in thread
From: De Lara Guarch, Pablo @ 2017-03-09 21:45 UTC (permalink / raw)
  To: Mrozowicz, SlawomirX, Doherty, Declan; +Cc: dev, Mrozowicz, SlawomirX, stable



> -----Original Message-----
> From: De Lara Guarch, Pablo
> Sent: Thursday, March 09, 2017 9:25 PM
> To: De Lara Guarch, Pablo; Mrozowicz, SlawomirX; Doherty, Declan
> Cc: dev@dpdk.org; Mrozowicz, SlawomirX
> Subject: RE: [dpdk-dev] [PATCH] app/crypto-perf: fix invalid latency for QAT
> PMD
> 
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of De Lara Guarch,
> > Pablo
> > Sent: Monday, March 06, 2017 4:29 PM
> > To: Mrozowicz, SlawomirX; Doherty, Declan
> > Cc: dev@dpdk.org; Mrozowicz, SlawomirX
> > Subject: Re: [dpdk-dev] [PATCH] app/crypto-perf: fix invalid latency for
> QAT
> > PMD
> >
> >
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Slawomir
> > > Mrozowicz
> > > Sent: Thursday, February 16, 2017 3:51 PM
> > > To: Doherty, Declan
> > > Cc: dev@dpdk.org; Mrozowicz, SlawomirX
> > > Subject: [dpdk-dev] [PATCH] app/crypto-perf: fix invalid latency for QAT
> > > PMD
> > >
> > > Fixes invalid latency result when using the performance application and
> > > hardware QAT PMD. It occurred when the number of processed packets
> > was
> > > higher then the size of the internal QAT PMD ring buffer and the buffer
> > > was overflowed.
> > > Fixed by correcting the registration of the enqueued packets and freeing
> > > memory space for not enqueued packets.
> > >
> > > Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test
> > > application")
> > >
> > > Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
> >
> > Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> 
> Applied to dpdk-next-crypto.
> Thanks,
> 
> Pablo

CC'ing stable list.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-09 21:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-16 15:51 [dpdk-dev] [PATCH] app/crypto-perf: fix invalid latency for QAT PMD Slawomir Mrozowicz
2017-03-06 16:29 ` De Lara Guarch, Pablo
2017-03-09 21:25   ` De Lara Guarch, Pablo
2017-03-09 21:45     ` De Lara Guarch, Pablo

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).