DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] app/crypto-perf: check crypto result
@ 2023-04-20 10:32 Anoob Joseph
  2023-04-20 12:22 ` [PATCH v2] " Anoob Joseph
  0 siblings, 1 reply; 4+ messages in thread
From: Anoob Joseph @ 2023-04-20 10:32 UTC (permalink / raw)
  To: Ciara Power, Akhil Goyal; +Cc: Jerin Jacob, Tejasree Kondoj, dev

Check crypto result in latency tests. Checking result won't affect the
test results as latency is calculated using timestamps which are done
before enqueue and after dequeue. Ignoring result means the data can be
false positive.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 app/test-crypto-perf/cperf_test_latency.c | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c
index 406e082e4e..64bef2cc0e 100644
--- a/app/test-crypto-perf/cperf_test_latency.c
+++ b/app/test-crypto-perf/cperf_test_latency.c
@@ -134,6 +134,7 @@ cperf_latency_test_runner(void *arg)
 	uint16_t test_burst_size;
 	uint8_t burst_size_idx = 0;
 	uint32_t imix_idx = 0;
+	int ret = 0;
 
 	static uint16_t display_once;
 
@@ -258,10 +259,16 @@ cperf_latency_test_runner(void *arg)
 			}
 
 			if (likely(ops_deqd))  {
-				/* Free crypto ops so they can be reused. */
-				for (i = 0; i < ops_deqd; i++)
+				for (i = 0; i < ops_deqd; i++) {
+					struct rte_crypto_op *op = ops_processed[i];
+
+					if (op->status == RTE_CRYPTO_OP_STATUS_ERROR)
+						ret = -1;
+
 					store_timestamp(ops_processed[i], tsc_end);
+				}
 
+				/* Free crypto ops so they can be reused. */
 				rte_mempool_put_bulk(ctx->pool,
 						(void **)ops_processed, ops_deqd);
 
@@ -289,8 +296,14 @@ cperf_latency_test_runner(void *arg)
 			tsc_end = rte_rdtsc_precise();
 
 			if (ops_deqd != 0) {
-				for (i = 0; i < ops_deqd; i++)
+				for (i = 0; i < ops_deqd; i++) {
+					struct rte_crypto_op *op = ops_processed[i];
+
+					if (op->status == RTE_CRYPTO_OP_STATUS_ERROR)
+						ret = -1;
+
 					store_timestamp(ops_processed[i], tsc_end);
+				}
 
 				rte_mempool_put_bulk(ctx->pool,
 						(void **)ops_processed, ops_deqd);
@@ -301,6 +314,10 @@ cperf_latency_test_runner(void *arg)
 			}
 		}
 
+		/* If there was any failure in crypto op, exit */
+		if (ret)
+			return ret;
+
 		for (i = 0; i < tsc_idx; i++) {
 			tsc_val = ctx->res[i].tsc_end - ctx->res[i].tsc_start;
 			tsc_max = RTE_MAX(tsc_val, tsc_max);
-- 
2.25.1


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

* [PATCH v2] app/crypto-perf: check crypto result
  2023-04-20 10:32 [PATCH] app/crypto-perf: check crypto result Anoob Joseph
@ 2023-04-20 12:22 ` Anoob Joseph
  2023-05-17 15:34   ` Power, Ciara
  0 siblings, 1 reply; 4+ messages in thread
From: Anoob Joseph @ 2023-04-20 12:22 UTC (permalink / raw)
  To: Ciara Power, Akhil Goyal; +Cc: Jerin Jacob, Tejasree Kondoj, dev

Check crypto result in latency tests. Checking result won't affect the
test results as latency is calculated using timestamps which are done
before enqueue and after dequeue. Ignoring result means the data can be
false positive.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
v2:
- Improved result check (treat all non success as errors)

 app/test-crypto-perf/cperf_test_latency.c | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c
index 406e082e4e..f1676a9aa9 100644
--- a/app/test-crypto-perf/cperf_test_latency.c
+++ b/app/test-crypto-perf/cperf_test_latency.c
@@ -134,6 +134,7 @@ cperf_latency_test_runner(void *arg)
 	uint16_t test_burst_size;
 	uint8_t burst_size_idx = 0;
 	uint32_t imix_idx = 0;
+	int ret = 0;
 
 	static uint16_t display_once;
 
@@ -258,10 +259,16 @@ cperf_latency_test_runner(void *arg)
 			}
 
 			if (likely(ops_deqd))  {
-				/* Free crypto ops so they can be reused. */
-				for (i = 0; i < ops_deqd; i++)
+				for (i = 0; i < ops_deqd; i++) {
+					struct rte_crypto_op *op = ops_processed[i];
+
+					if (op->status != RTE_CRYPTO_OP_STATUS_SUCCESS)
+						ret = -1;
+
 					store_timestamp(ops_processed[i], tsc_end);
+				}
 
+				/* Free crypto ops so they can be reused. */
 				rte_mempool_put_bulk(ctx->pool,
 						(void **)ops_processed, ops_deqd);
 
@@ -289,8 +296,14 @@ cperf_latency_test_runner(void *arg)
 			tsc_end = rte_rdtsc_precise();
 
 			if (ops_deqd != 0) {
-				for (i = 0; i < ops_deqd; i++)
+				for (i = 0; i < ops_deqd; i++) {
+					struct rte_crypto_op *op = ops_processed[i];
+
+					if (op->status != RTE_CRYPTO_OP_STATUS_SUCCESS)
+						ret = -1;
+
 					store_timestamp(ops_processed[i], tsc_end);
+				}
 
 				rte_mempool_put_bulk(ctx->pool,
 						(void **)ops_processed, ops_deqd);
@@ -301,6 +314,10 @@ cperf_latency_test_runner(void *arg)
 			}
 		}
 
+		/* If there was any failure in crypto op, exit */
+		if (ret)
+			return ret;
+
 		for (i = 0; i < tsc_idx; i++) {
 			tsc_val = ctx->res[i].tsc_end - ctx->res[i].tsc_start;
 			tsc_max = RTE_MAX(tsc_val, tsc_max);
-- 
2.25.1


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

* RE: [PATCH v2] app/crypto-perf: check crypto result
  2023-04-20 12:22 ` [PATCH v2] " Anoob Joseph
@ 2023-05-17 15:34   ` Power, Ciara
  2023-05-24 12:18     ` Akhil Goyal
  0 siblings, 1 reply; 4+ messages in thread
From: Power, Ciara @ 2023-05-17 15:34 UTC (permalink / raw)
  To: Anoob Joseph, Akhil Goyal; +Cc: Jerin Jacob, Tejasree Kondoj, dev



> -----Original Message-----
> From: Anoob Joseph <anoobj@marvell.com>
> Sent: Thursday 20 April 2023 13:23
> To: Power, Ciara <ciara.power@intel.com>; Akhil Goyal
> <gakhil@marvell.com>
> Cc: Jerin Jacob <jerinj@marvell.com>; Tejasree Kondoj
> <ktejasree@marvell.com>; dev@dpdk.org
> Subject: [PATCH v2] app/crypto-perf: check crypto result
> 
> Check crypto result in latency tests. Checking result won't affect the test
> results as latency is calculated using timestamps which are done before
> enqueue and after dequeue. Ignoring result means the data can be false
> positive.
> 
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> ---
> v2:
> - Improved result check (treat all non success as errors)
<snip>

Acked-by: Ciara Power <ciara.power@intel.com>


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

* RE: [PATCH v2] app/crypto-perf: check crypto result
  2023-05-17 15:34   ` Power, Ciara
@ 2023-05-24 12:18     ` Akhil Goyal
  0 siblings, 0 replies; 4+ messages in thread
From: Akhil Goyal @ 2023-05-24 12:18 UTC (permalink / raw)
  To: Power, Ciara, Anoob Joseph
  Cc: Jerin Jacob Kollanukkaran, Tejasree Kondoj, dev

> > Subject: [PATCH v2] app/crypto-perf: check crypto result
> >
> > Check crypto result in latency tests. Checking result won't affect the test
> > results as latency is calculated using timestamps which are done before
> > enqueue and after dequeue. Ignoring result means the data can be false
> > positive.
> >
> > Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> Acked-by: Ciara Power <ciara.power@intel.com>

Applied to dpdk-next-crypto
Thanks.


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

end of thread, other threads:[~2023-05-24 12:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-20 10:32 [PATCH] app/crypto-perf: check crypto result Anoob Joseph
2023-04-20 12:22 ` [PATCH v2] " Anoob Joseph
2023-05-17 15:34   ` Power, Ciara
2023-05-24 12:18     ` Akhil Goyal

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