* [dpdk-dev] [PATCH 1/3] test/crypto: fix stat test
2020-08-31 8:51 [dpdk-dev] [PATCH 0/3] armv8 crypto PMD Ruifeng Wang
@ 2020-08-31 8:51 ` Ruifeng Wang
2020-09-01 9:46 ` Dybkowski, AdamX
2020-08-31 8:51 ` [dpdk-dev] [PATCH 2/3] crypto/armv8: fix mempool object returning Ruifeng Wang
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Ruifeng Wang @ 2020-08-31 8:51 UTC (permalink / raw)
To: Declan Doherty, Fiona Trahe, John Griffin, Des O Dea,
Sergio Gonzalez Monroy
Cc: dev, akhil.goyal, honnappa.nagarahalli, nd, Ruifeng Wang, stable
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.
Fixes: 202d375c60bc ("app/test: add cryptodev unit and performance tests")
Cc: declan.doherty@intel.com
Cc: stable@dpdk.org
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
app/test/test_cryptodev.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 70bf6fe2c..068b8c9c1 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -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");
--
2.17.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH 1/3] test/crypto: fix stat test
2020-08-31 8:51 ` [dpdk-dev] [PATCH 1/3] test/crypto: fix stat test Ruifeng Wang
@ 2020-09-01 9:46 ` Dybkowski, AdamX
0 siblings, 0 replies; 6+ messages in thread
From: Dybkowski, AdamX @ 2020-09-01 9:46 UTC (permalink / raw)
To: Ruifeng Wang, Doherty, Declan, Trahe, Fiona, Griffin, John,
Des O Dea, Sergio Gonzalez Monroy
Cc: dev, akhil.goyal, honnappa.nagarahalli, nd, stable
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Ruifeng Wang
> Sent: Monday, 31 August, 2020 10:52
> To: Doherty, Declan <declan.doherty@intel.com>; Trahe, Fiona
> <fiona.trahe@intel.com>; Griffin, John <john.griffin@intel.com>; Des O Dea
> <des.j.o.dea@intel.com>; Sergio Gonzalez Monroy
> <sergio.gonzalez.monroy@intel.com>
> Cc: dev@dpdk.org; akhil.goyal@nxp.com; honnappa.nagarahalli@arm.com;
> nd@arm.com; Ruifeng Wang <ruifeng.wang@arm.com>; stable@dpdk.org
> Subject: [dpdk-dev] [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.
>
> Fixes: 202d375c60bc ("app/test: add cryptodev unit and performance tests")
> Cc: declan.doherty@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Tested-by: Adam Dybkowski <adamx.dybkowski@intel.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH 2/3] crypto/armv8: fix mempool object returning
2020-08-31 8:51 [dpdk-dev] [PATCH 0/3] armv8 crypto PMD Ruifeng Wang
2020-08-31 8:51 ` [dpdk-dev] [PATCH 1/3] test/crypto: fix stat test Ruifeng Wang
@ 2020-08-31 8:51 ` Ruifeng Wang
2020-08-31 8:51 ` [dpdk-dev] [PATCH 3/3] crypto/armv8: move to cryptodev test suite Ruifeng Wang
2020-10-08 21:05 ` [dpdk-dev] [PATCH 0/3] armv8 crypto PMD Akhil Goyal
3 siblings, 0 replies; 6+ messages in thread
From: Ruifeng Wang @ 2020-08-31 8:51 UTC (permalink / raw)
To: Ruifeng Wang, Akhil Goyal, Slawomir Mrozowicz, Pablo de Lara,
Declan Doherty, Fiona Trahe, Fan Zhang
Cc: dev, honnappa.nagarahalli, nd, stable
Crypto 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.
Fixes: b3bbd9e5f265 ("cryptodev: support device independent sessions")
Fixes: 725d2a7fbf71 ("cryptodev: change queue pair configure structure")
Cc: stable@dpdk.org
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
drivers/crypto/armv8/rte_armv8_pmd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/armv8/rte_armv8_pmd.c b/drivers/crypto/armv8/rte_armv8_pmd.c
index c95729db5..72d29ae0c 100644
--- a/drivers/crypto/armv8/rte_armv8_pmd.c
+++ b/drivers/crypto/armv8/rte_armv8_pmd.c
@@ -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;
}
--
2.17.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH 3/3] crypto/armv8: move to cryptodev test suite
2020-08-31 8:51 [dpdk-dev] [PATCH 0/3] armv8 crypto PMD Ruifeng Wang
2020-08-31 8:51 ` [dpdk-dev] [PATCH 1/3] test/crypto: fix stat test Ruifeng Wang
2020-08-31 8:51 ` [dpdk-dev] [PATCH 2/3] crypto/armv8: fix mempool object returning Ruifeng Wang
@ 2020-08-31 8:51 ` Ruifeng Wang
2020-10-08 21:05 ` [dpdk-dev] [PATCH 0/3] armv8 crypto PMD Akhil Goyal
3 siblings, 0 replies; 6+ messages in thread
From: Ruifeng Wang @ 2020-08-31 8:51 UTC (permalink / raw)
To: Declan Doherty; +Cc: dev, akhil.goyal, honnappa.nagarahalli, nd, Ruifeng Wang
Switched from device specific test suite to unified cryptodev test suite.
Removed the armv8 device specific test suite.
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
app/test/test_cryptodev.c | 19 +------------------
1 file changed, 1 insertion(+), 18 deletions(-)
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 068b8c9c1..7cdf9587e 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -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
--
2.17.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH 0/3] armv8 crypto PMD
2020-08-31 8:51 [dpdk-dev] [PATCH 0/3] armv8 crypto PMD Ruifeng Wang
` (2 preceding siblings ...)
2020-08-31 8:51 ` [dpdk-dev] [PATCH 3/3] crypto/armv8: move to cryptodev test suite Ruifeng Wang
@ 2020-10-08 21:05 ` Akhil Goyal
3 siblings, 0 replies; 6+ messages in thread
From: Akhil Goyal @ 2020-10-08 21:05 UTC (permalink / raw)
To: Ruifeng Wang; +Cc: dev, honnappa.nagarahalli, nd
> 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(-)
Series Acked and Applied to dpdk-next-crypto
Thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread