DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] test/crypto: allow retries with stats test
@ 2024-08-26  8:54 Anoob Joseph
  2024-08-26  8:54 ` [PATCH 2/2] crypto/cnxk: remove delay in stats Anoob Joseph
  2024-09-18  4:42 ` [PATCH 1/2] test/crypto: allow retries with stats test Akhil Goyal
  0 siblings, 2 replies; 3+ messages in thread
From: Anoob Joseph @ 2024-08-26  8:54 UTC (permalink / raw)
  To: Akhil Goyal, Fan Zhang
  Cc: Hemant Agrawal, Jerin Jacob, Aakash Sasidharan, Tejasree Kondoj,
	Vidya Sagar Velumuri, dev

Stats need not be reflected instantly after the operation. Relax the
test case to have retries to allow slower updates.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 app/test/test_cryptodev.h                |  1 +
 app/test/test_cryptodev_security_ipsec.c | 11 ++++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/app/test/test_cryptodev.h b/app/test/test_cryptodev.h
index b479ab8a2a..bb54a33d62 100644
--- a/app/test/test_cryptodev.h
+++ b/app/test/test_cryptodev.h
@@ -9,6 +9,7 @@
 #define MAX_NUM_OPS_INFLIGHT            (4096)
 #define MIN_NUM_OPS_INFLIGHT            (128)
 #define DEFAULT_NUM_OPS_INFLIGHT        (128)
+#define TEST_STATS_RETRIES              (100)
 
 #define DEFAULT_NUM_XFORMS              (2)
 #define NUM_MBUFS                       (8191)
diff --git a/app/test/test_cryptodev_security_ipsec.c b/app/test/test_cryptodev_security_ipsec.c
index 1aba1ad993..e6a81ca186 100644
--- a/app/test/test_cryptodev_security_ipsec.c
+++ b/app/test/test_cryptodev_security_ipsec.c
@@ -1103,9 +1103,12 @@ test_ipsec_stats_verify(void *ctx,
 			enum rte_security_ipsec_sa_direction dir)
 {
 	struct rte_security_stats stats = {0};
-	int ret = TEST_SUCCESS;
+	int retries = 0, ret = TEST_SUCCESS;
 
 	if (flags->stats_success) {
+stats_get:
+		ret = TEST_SUCCESS;
+
 		if (rte_security_session_stats_get(ctx, sess, &stats) < 0)
 			return TEST_FAILED;
 
@@ -1118,6 +1121,12 @@ test_ipsec_stats_verify(void *ctx,
 			    stats.ipsec.ierrors != 0)
 				ret = TEST_FAILED;
 		}
+
+		if (ret == TEST_FAILED && retries < TEST_STATS_RETRIES) {
+			retries++;
+			rte_delay_ms(1);
+			goto stats_get;
+		}
 	}
 
 	return ret;
-- 
2.45.2


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

* [PATCH 2/2] crypto/cnxk: remove delay in stats
  2024-08-26  8:54 [PATCH 1/2] test/crypto: allow retries with stats test Anoob Joseph
@ 2024-08-26  8:54 ` Anoob Joseph
  2024-09-18  4:42 ` [PATCH 1/2] test/crypto: allow retries with stats test Akhil Goyal
  1 sibling, 0 replies; 3+ messages in thread
From: Anoob Joseph @ 2024-08-26  8:54 UTC (permalink / raw)
  To: Akhil Goyal, Fan Zhang
  Cc: Hemant Agrawal, Jerin Jacob, Aakash Sasidharan, Tejasree Kondoj,
	Vidya Sagar Velumuri, dev

Having 1 ms delay for retrieving stats per session would mean
significant delay for a system with large number of sessions. If
accurate stats are required, application can call stats again
after a delay and get most updated stats.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 drivers/crypto/cnxk/cn10k_ipsec.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/crypto/cnxk/cn10k_ipsec.c b/drivers/crypto/cnxk/cn10k_ipsec.c
index 7517602fa4..8123a5f97b 100644
--- a/drivers/crypto/cnxk/cn10k_ipsec.c
+++ b/drivers/crypto/cnxk/cn10k_ipsec.c
@@ -350,13 +350,11 @@ cn10k_ipsec_stats_get(struct cnxk_cpt_qp *qp, struct cn10k_sec_session *sess,
 	if (sess->ipsec.is_outbound) {
 		out_sa = &sa->out_sa;
 		roc_cpt_lf_ctx_flush(&qp->lf, out_sa, false);
-		rte_delay_ms(1);
 		stats->ipsec.opackets = out_sa->ctx.mib_pkts;
 		stats->ipsec.obytes = out_sa->ctx.mib_octs;
 	} else {
 		in_sa = &sa->in_sa;
 		roc_cpt_lf_ctx_flush(&qp->lf, in_sa, false);
-		rte_delay_ms(1);
 		stats->ipsec.ipackets = in_sa->ctx.mib_pkts;
 		stats->ipsec.ibytes = in_sa->ctx.mib_octs;
 	}
-- 
2.45.2


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

* RE: [PATCH 1/2] test/crypto: allow retries with stats test
  2024-08-26  8:54 [PATCH 1/2] test/crypto: allow retries with stats test Anoob Joseph
  2024-08-26  8:54 ` [PATCH 2/2] crypto/cnxk: remove delay in stats Anoob Joseph
@ 2024-09-18  4:42 ` Akhil Goyal
  1 sibling, 0 replies; 3+ messages in thread
From: Akhil Goyal @ 2024-09-18  4:42 UTC (permalink / raw)
  To: Anoob Joseph, Fan Zhang
  Cc: Hemant Agrawal, Jerin Jacob, Aakash Sasidharan, Tejasree Kondoj,
	Vidya Sagar Velumuri, dev

> Subject: [PATCH 1/2] test/crypto: allow retries with stats test
> 
> Stats need not be reflected instantly after the operation. Relax the
> test case to have retries to allow slower updates.
> 
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Series Acked-by: Akhil Goyal <gakhil@marvell.com>

Applied to dpdk-next-crypto
Thanks.

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

end of thread, other threads:[~2024-09-18  4:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-26  8:54 [PATCH 1/2] test/crypto: allow retries with stats test Anoob Joseph
2024-08-26  8:54 ` [PATCH 2/2] crypto/cnxk: remove delay in stats Anoob Joseph
2024-09-18  4:42 ` [PATCH 1/2] test/crypto: allow retries with stats test 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).