From patchwork Mon Aug 26 08:54:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anoob Joseph X-Patchwork-Id: 143388 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A33DB4586A; Mon, 26 Aug 2024 10:54:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 65BB8402A7; Mon, 26 Aug 2024 10:54:44 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 72A1440272 for ; Mon, 26 Aug 2024 10:54:42 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47Q5tZ4w032034; Mon, 26 Aug 2024 01:54:41 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=pfpt0220; bh=GQNsZX576LOWhapgKtm/ivp kKwMvYPUzBhyf/EUgBHU=; b=jPcshHr0iKqJ9vx/jL8OoLtV2DCw91kB1QAyGwU bDZ8XHASIBUkmBU8lGUnj6AfxeYYs7DZqajBR/2ByOnBE9X6wivNERIiYJ+mz7Ma tiRAwzASjtY8odFA7gXxgqziqZRy+4L7hiRZTjO/PiHaPOhXeWd1wd1XAFy+l5gK 46w4nagvyDHiWSaNGwQuldn1OHlNATdgpiOiqRSjygbAWgLKALmSza/vGoUZN3sn Rj6rSX+GuxmpmYHFX3n+0u4D5DgCxf2/G6G4N6j19RUyyLDXKRKzWlEoeG/+6BG2 LeC4e0JaryQZSFpJOXPipwO1rpZDJqHqdmEdgrx9VaCIaJQ== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 418m030g8b-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Aug 2024 01:54:41 -0700 (PDT) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 26 Aug 2024 01:54:37 -0700 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 26 Aug 2024 01:54:36 -0700 Received: from anoobj2204.marvell.com (unknown [10.28.34.118]) by maili.marvell.com (Postfix) with ESMTP id 20B313F704D; Mon, 26 Aug 2024 01:54:33 -0700 (PDT) From: Anoob Joseph To: Akhil Goyal , Fan Zhang CC: Hemant Agrawal , Jerin Jacob , Aakash Sasidharan , Tejasree Kondoj , Vidya Sagar Velumuri , Subject: [PATCH 1/2] test/crypto: allow retries with stats test Date: Mon, 26 Aug 2024 08:54:21 +0000 Message-ID: <20240826085432.2480734-1-anoobj@marvell.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: d6tU0sUd3Nfqt060cFnHVWcr-aH666Hw X-Proofpoint-GUID: d6tU0sUd3Nfqt060cFnHVWcr-aH666Hw X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-26_06,2024-08-23_01,2024-05-17_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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; From patchwork Mon Aug 26 08:54:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anoob Joseph X-Patchwork-Id: 143389 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 74A3E4586A; Mon, 26 Aug 2024 11:00:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 09445402A7; Mon, 26 Aug 2024 11:00:35 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 7D4A440272 for ; Mon, 26 Aug 2024 11:00:32 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47Q5tVql031947; Mon, 26 Aug 2024 02:00:31 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=j dWFXAARqmTc2gwfoTQLRbC/kTAVQog4EWcNXfs6Qgs=; b=Dd9Ihep8qjQOo0ka8 lwZwfnugD21PVNg/NTD6GjAf4Tnp1V9ENFyW5DWCCApzbjRjeh7rnD8nfRXW+ArS t0HRCLSeVZAawj8RNn3dGWWvLhbGsUW8fi4oKZnG0e6X2kT1tARCgLwYc2fdFnsJ I/jVF/vOWABIAHzkvf9O4L6vX3GQNeJ7hACrQhQqtGQfmEz9oTmkZ1mfhekBM0OX ZJv9abrsLUJcnmRkUedkGZXXvQGuSzLvD0WPepSDSvGQeHJcCbMkvfraoh0HAAmr niKM423frRNiQQzWMKwb4xBpEA++seOkBcW247HAizc7BWd4t+Z14y0/tw8z4EsN XhYmw== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 418m030gv2-7 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Aug 2024 02:00:31 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 26 Aug 2024 01:54:40 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 26 Aug 2024 01:54:40 -0700 Received: from anoobj2204.marvell.com (unknown [10.28.34.118]) by maili.marvell.com (Postfix) with ESMTP id 533D83F704D; Mon, 26 Aug 2024 01:54:37 -0700 (PDT) From: Anoob Joseph To: Akhil Goyal , Fan Zhang CC: Hemant Agrawal , Jerin Jacob , Aakash Sasidharan , Tejasree Kondoj , Vidya Sagar Velumuri , Subject: [PATCH 2/2] crypto/cnxk: remove delay in stats Date: Mon, 26 Aug 2024 08:54:22 +0000 Message-ID: <20240826085432.2480734-2-anoobj@marvell.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240826085432.2480734-1-anoobj@marvell.com> References: <20240826085432.2480734-1-anoobj@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: K1jCseP2LFyWagd4a2G9zmQAQei2Kqf- X-Proofpoint-GUID: K1jCseP2LFyWagd4a2G9zmQAQei2Kqf- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-26_06,2024-08-23_01,2024-05-17_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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; }