[1/2] test/crypto: allow retries with stats test
Checks
Commit Message
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(-)
Comments
> 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.
@@ -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)
@@ -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;