DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] test/crypto: remove redundant code
@ 2023-05-12 14:21 Anoob Joseph
  2023-05-16 10:03 ` Akhil Goyal
  2023-05-17 15:47 ` Power, Ciara
  0 siblings, 2 replies; 4+ messages in thread
From: Anoob Joseph @ 2023-05-12 14:21 UTC (permalink / raw)
  To: Akhil Goyal, Fan Zhang, Ciara Power
  Cc: Hemant Agrawal, Gagandeep Singh, Jerin Jacob, Tejasree Kondoj, dev

Code for registering raw API tests for various PMDs are repeated.
Add common routine to avoid duplication of code.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 app/test/test_cryptodev.c | 40 ++++++++++-----------------------------
 1 file changed, 10 insertions(+), 30 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index d212e71ba6..f44e8b3101 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -17462,13 +17462,11 @@ test_cryptodev_bcmfs(void)
 }
 
 static int
-test_cryptodev_qat_raw_api(void)
+run_cryptodev_raw_testsuite(const char *pmd_name)
 {
-	static const char *pmd_name = RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD);
 	int ret;
 
-	ret = require_feature_flag(pmd_name, RTE_CRYPTODEV_FF_SYM_RAW_DP,
-			"RAW API");
+	ret = require_feature_flag(pmd_name, RTE_CRYPTODEV_FF_SYM_RAW_DP, "RAW API");
 	if (ret)
 		return ret;
 
@@ -17479,6 +17477,12 @@ test_cryptodev_qat_raw_api(void)
 	return ret;
 }
 
+static int
+test_cryptodev_qat_raw_api(void)
+{
+	return run_cryptodev_raw_testsuite(RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD));
+}
+
 static int
 test_cryptodev_cn9k(void)
 {
@@ -17494,37 +17498,13 @@ test_cryptodev_cn10k(void)
 static int
 test_cryptodev_dpaa2_sec_raw_api(void)
 {
-	static const char *pmd_name = RTE_STR(CRYPTODEV_NAME_DPAA2_SEC_PMD);
-	int ret;
-
-	ret = require_feature_flag(pmd_name, RTE_CRYPTODEV_FF_SYM_RAW_DP,
-			"RAW API");
-	if (ret)
-		return ret;
-
-	global_api_test_type = CRYPTODEV_RAW_API_TEST;
-	ret = run_cryptodev_testsuite(pmd_name);
-	global_api_test_type = CRYPTODEV_API_TEST;
-
-	return ret;
+	return run_cryptodev_raw_testsuite(RTE_STR(CRYPTODEV_NAME_DPAA2_SEC_PMD));
 }
 
 static int
 test_cryptodev_dpaa_sec_raw_api(void)
 {
-	static const char *pmd_name = RTE_STR(CRYPTODEV_NAME_DPAA_SEC_PMD);
-	int ret;
-
-	ret = require_feature_flag(pmd_name, RTE_CRYPTODEV_FF_SYM_RAW_DP,
-			"RAW API");
-	if (ret)
-		return ret;
-
-	global_api_test_type = CRYPTODEV_RAW_API_TEST;
-	ret = run_cryptodev_testsuite(pmd_name);
-	global_api_test_type = CRYPTODEV_API_TEST;
-
-	return ret;
+	return run_cryptodev_raw_testsuite(RTE_STR(CRYPTODEV_NAME_DPAA_SEC_PMD));
 }
 
 REGISTER_TEST_COMMAND(cryptodev_dpaa2_sec_raw_api_autotest,
-- 
2.25.1


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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-12 14:21 [PATCH] test/crypto: remove redundant code Anoob Joseph
2023-05-16 10:03 ` Akhil Goyal
2023-05-17 15:47 ` Power, Ciara
2023-05-24 12:30   ` 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).