From: Anoob Joseph <anoobj@marvell.com>
To: Akhil Goyal <gakhil@marvell.com>, Fan Zhang <fanzhang.oss@gmail.com>
Cc: Hemant Agrawal <hemant.agrawal@nxp.com>,
Jerin Jacob <jerinj@marvell.com>,
Aakash Sasidharan <asasidharan@marvell.com>,
Tejasree Kondoj <ktejasree@marvell.com>,
Vidya Sagar Velumuri <vvelumuri@marvell.com>, <dev@dpdk.org>
Subject: [PATCH 1/2] test/crypto: allow retries with stats test
Date: Mon, 26 Aug 2024 08:54:21 +0000 [thread overview]
Message-ID: <20240826085432.2480734-1-anoobj@marvell.com> (raw)
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
next reply other threads:[~2024-08-26 8:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-26 8:54 Anoob Joseph [this message]
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
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=20240826085432.2480734-1-anoobj@marvell.com \
--to=anoobj@marvell.com \
--cc=asasidharan@marvell.com \
--cc=dev@dpdk.org \
--cc=fanzhang.oss@gmail.com \
--cc=gakhil@marvell.com \
--cc=hemant.agrawal@nxp.com \
--cc=jerinj@marvell.com \
--cc=ktejasree@marvell.com \
--cc=vvelumuri@marvell.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).