test/crypto: remove redundant code
PATCH 1/1 test/crypto: remove redundant code
Code for registering raw API tests for various PMDs are repeated. Add common routine to avoid duplication of code.
--- app/test/test_cryptodev.c | 40 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 30 deletions(-)
app/test/test_cryptodev.c +10 -30
@@ -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,
Signature · 1 line
2.25.1
Quoted 7 lines
Subject: [PATCH] test/crypto: remove redundant code
Code for registering raw API tests for various PMDs are repeated. Add common routine to avoid duplication of code.
Signed-off-by Anoob Joseph <[email protected]>---
Quoted 19 lines
-----Original Message-----
From: Anoob Joseph <[email protected]>
Sent: Friday 12 May 2023 15:22
To: Akhil Goyal <[email protected]>; Fan Zhang <[email protected]>; Power, Ciara <[email protected]>
Cc: Hemant Agrawal <[email protected]>; Gagandeep Singh <[email protected]>; Jerin Jacob <[email protected]>; Tejasree Kondoj <[email protected]>; [email protected]
Subject: [PATCH] test/crypto: remove redundant codeCode for registering raw API tests for various PMDs are repeated. Add common routine to avoid duplication of code.
Signed-off-by Anoob Joseph <[email protected]>--- app/test/test_cryptodev.c | 40 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 30 deletions(-)
<snip>
Akhil Goyal
AppliedQuoted 5 lines
Quoted 5 lines
Subject: [PATCH] test/crypto: remove redundant code
Code for registering raw API tests for various PMDs are repeated. Add common routine to avoid duplication of code.
Quoted 7 lines
Quoted 4 lines
Signed-off-by Anoob Joseph <[email protected]>--- app/test/test_cryptodev.c | 40 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 30 deletions(-)<snip>
Acked-by Ciara Power <[email protected]>
Applied to dpdk-next-crypto
Thanks.