armv8 crypto PMD
cover armv8 crypto PMD
This patch set migrates armv8 crypto PMD unit test from device specific test suite to common crypto dev test suite. Fixed couple of issues found during the migration.
Ruifeng Wang (3):
test/crypto: fix stat test
crypto/armv8: fix mempool object returning
crypto/armv8: move to cryptodev test suite
app/test/test_cryptodev.c | 21 +-------------------- drivers/crypto/armv8/rte_armv8_pmd.c | 4 ++-- 2 files changed, 3 insertions(+), 22 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/3 test/crypto: fix stat test
ut_setup / ut_teardown are invoked for each test case by test framework. The call inside test_stats is unnecessary and even incorrect. This caused double free of objects such as crypto operation structure. Trapped the issue when RTE_LIBRTE_MEMPOOL_DEBUG was enabled. Fix issue by removing ut_setup / ut_teardown from test case implementation.
--- app/test/test_cryptodev.c | 2 -- 1 file changed, 2 deletions(-)
app/test/test_cryptodev.c +0 -2
@@ -9326,9 +9326,7 @@ test_stats(void) "rte_cryptodev_stats_get invalid Param failed");/* Test expected values */ -ut_setup ();test_AES_CBC_HMAC_SHA1_encrypt_digest (); -ut_teardown ();TEST_ASSERT_SUCCESS (rte_cryptodev_stats_get (ts_params->valid_devs[0 ], &stats),"rte_cryptodev_stats_get failed" );
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 1/3] test/crypto: fix stat test
Quoted 18 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Ruifeng Wang
Sent: Monday, 31 August, 2020 10:52
To: Doherty, Declan <[email protected]>; Trahe, Fiona <[email protected]>; Griffin, John <[email protected]>; Des O Dea <[email protected]>; Sergio Gonzalez Monroy <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Ruifeng Wang <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH 1/3] test/crypto: fix stat test
ut_setup/ut_teardownare invoked for each test case by test framework. The call insidetest_statsis unnecessary and even incorrect. This caused double free of objects such as crypto operation structure. Trapped the issue whenRTE_LIBRTE_MEMPOOL_DEBUGwas enabled. Fix issue by removingut_setup/ut_teardownfrom test case implementation.
Quoted 5 lines
Fixes 202d375c60bc ("app/test: add cryptodev unit and performance tests")Signed-off-by Ruifeng Wang <[email protected]>
PATCH 2/3 crypto/armv8: fix mempool object returning
In reply to Ruifeng WangCrypto session and device session private data were put back to wrong pools.
This caused data corruption when the object was reallocated and used. Because objects from different mempools have different element size, and wrong mempool info caused out of bound write.
Fix the issue by putting back objects to correct mempools.
--- drivers/crypto/armv8/rte_armv8_pmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/armv8/rte_armv8_pmd.c +2 -2
@@ -674,8 +674,8 @@ process_op(struct armv8_crypto_qp *qp, struct rte_crypto_op *op,memset (op->sym->session,0 ,rte_cryptodev_sym_get_existing_header_session_size ( op->sym->session)); -rte_mempool_put (qp->sess_mp, sess); -rte_mempool_put (qp->sess_mp_priv, op->sym->session); +rte_mempool_put (qp->sess_mp_priv, sess); +rte_mempool_put (qp->sess_mp, op->sym->session); op->sym->session =NULL ; }
Signature · 1 line
2.17.1
PATCH 3/3 crypto/armv8: move to cryptodev test suite
In reply to Ruifeng WangSwitched from device specific test suite to unified cryptodev test suite. Removed the armv8 device specific test suite.
--- app/test/test_cryptodev.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-)
app/test/test_cryptodev.c +1 -18
@@ -12590,23 +12590,6 @@ static struct unit_test_suite cryptodev_caam_jr_testsuite = { } }; -static struct unit_test_suite cryptodev_armv8_testsuite = { - .suite_name ="Crypto Device ARMv8 Unit Test Suite" , - .setup = testsuite_setup, - .teardown = testsuite_teardown, - .unit_test_cases = { -TEST_CASE_ST (ut_setup, ut_teardown, test_AES_chain_all), - -/** Negative tests */ -TEST_CASE_ST (ut_setup, ut_teardown, - auth_decryption_AES128CBC_HMAC_SHA1_fail_data_corrupt), -TEST_CASE_ST (ut_setup, ut_teardown, - auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt), - -TEST_CASES_END ()/**< NULL terminate unit test array */ - } -}; -static struct unit_test_suite cryptodev_mrvl_testsuite = { .suite_name ="Crypto Device Marvell Component Test Suite" , .setup = testsuite_setup,
@@ -12882,7 +12865,7 @@ test_cryptodev_armv8(void)return TEST_SKIPPED ; } -return unit_test_suite_runner (&cryptodev_armv8_testsuite); +return unit_test_suite_runner (&cryptodev_testsuite); } static int
Signature · 1 line
2.17.1
Quoted 4 lines
This patch set migrates armv8 crypto PMD unit test from device specific test suite to common crypto dev test suite. Fixed couple of issues found during the migration.
Quoted 8 lines
Ruifeng Wang (3):
test/crypto: fix stat test
crypto/armv8: fix mempool object returning
crypto/armv8: move to cryptodev test suiteapp/test/test_cryptodev.c | 21 +-------------------- drivers/crypto/armv8/rte_armv8_pmd.c | 4 ++-- 2 files changed, 3 insertions(+), 22 deletions(-)
Series Acked and Applied to dpdk-next-crypto
Thanks.