This patch adds closing of the PMD after running the tests. Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com> --- app/test/test_cryptodev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index f91debc16..7dcd255de 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -976,8 +976,9 @@ ut_teardown(void) rte_cryptodev_stats_get(ts_params->valid_devs[0], &stats); - /* Stop the device */ + /* Stop and close the device */ rte_cryptodev_stop(ts_params->valid_devs[0]); + rte_cryptodev_close(ts_params->valid_devs[0]); } static int -- 2.25.1
This patch adds closing of the PMD after running the benchmark. Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com> --- app/test-crypto-perf/main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c index 49af812d8..c1d338fa4 100644 --- a/app/test-crypto-perf/main.c +++ b/app/test-crypto-perf/main.c @@ -738,8 +738,10 @@ main(int argc, char **argv) } for (i = 0; i < nb_cryptodevs && - i < RTE_CRYPTO_MAX_DEVS; i++) + i < RTE_CRYPTO_MAX_DEVS; i++) { rte_cryptodev_stop(enabled_cdevs[i]); + rte_cryptodev_close(enabled_cdevs[i]); + } free_test_vector(t_vec, &opts); @@ -758,8 +760,10 @@ main(int argc, char **argv) } for (i = 0; i < nb_cryptodevs && - i < RTE_CRYPTO_MAX_DEVS; i++) + i < RTE_CRYPTO_MAX_DEVS; i++) { rte_cryptodev_stop(enabled_cdevs[i]); + rte_cryptodev_close(enabled_cdevs[i]); + } rte_free(opts.imix_buffer_sizes); free_test_vector(t_vec, &opts); -- 2.25.1
This patch adds closing of the PMD after running the tests. -- v2: * display error message on close error Adam Dybkowski (2): test/crypto: close PMD after tests app/crypto-perf: close PMD after benchmark run app/test-crypto-perf/main.c | 15 +++++++++++++-- app/test/test_cryptodev.c | 6 +++++- 2 files changed, 18 insertions(+), 3 deletions(-) -- 2.25.1
This patch adds closing of the PMD after running the tests. Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com> --- app/test/test_cryptodev.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index f91debc16..ea965a64a 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -928,6 +928,7 @@ ut_teardown(void) struct crypto_testsuite_params *ts_params = &testsuite_params; struct crypto_unittest_params *ut_params = &unittest_params; struct rte_cryptodev_stats stats; + int res; /* free crypto session structure */ #ifdef RTE_LIB_SECURITY @@ -976,8 +977,11 @@ ut_teardown(void) rte_cryptodev_stats_get(ts_params->valid_devs[0], &stats); - /* Stop the device */ + /* Stop and close the device */ rte_cryptodev_stop(ts_params->valid_devs[0]); + res = rte_cryptodev_close(ts_params->valid_devs[0]); + if (res) + RTE_LOG(ERR, USER1, "Crypto device close error %d\n", res); } static int -- 2.25.1
This patch adds closing of the PMD after running the benchmark. Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com> --- app/test-crypto-perf/main.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c index 49af812d8..70cb04a21 100644 --- a/app/test-crypto-perf/main.c +++ b/app/test-crypto-perf/main.c @@ -738,8 +738,13 @@ main(int argc, char **argv) } for (i = 0; i < nb_cryptodevs && - i < RTE_CRYPTO_MAX_DEVS; i++) + i < RTE_CRYPTO_MAX_DEVS; i++) { rte_cryptodev_stop(enabled_cdevs[i]); + ret = rte_cryptodev_close(enabled_cdevs[i]); + if (ret) + RTE_LOG(ERR, USER1, + "Crypto device close error %d\n", ret); + } free_test_vector(t_vec, &opts); @@ -758,8 +763,14 @@ main(int argc, char **argv) } for (i = 0; i < nb_cryptodevs && - i < RTE_CRYPTO_MAX_DEVS; i++) + i < RTE_CRYPTO_MAX_DEVS; i++) { rte_cryptodev_stop(enabled_cdevs[i]); + ret = rte_cryptodev_close(enabled_cdevs[i]); + if (ret) + RTE_LOG(ERR, USER1, + "Crypto device close error %d\n", ret); + + } rte_free(opts.imix_buffer_sizes); free_test_vector(t_vec, &opts); -- 2.25.1
> -----Original Message-----
> From: Dybkowski, AdamX <adamx.dybkowski@intel.com>
> Sent: Monday, March 8, 2021 1:57 PM
> To: dev@dpdk.org; Doherty, Declan <declan.doherty@intel.com>; Kusztal,
> ArkadiuszX <arkadiuszx.kusztal@intel.com>
> Cc: Dybkowski, AdamX <adamx.dybkowski@intel.com>
> Subject: [PATCH v2 0/2] test/crypto: close PMD after tests
>
> This patch adds closing of the PMD after running the tests.
>
> --
> v2:
> * display error message on close error
>
>
> Adam Dybkowski (2):
> test/crypto: close PMD after tests
> app/crypto-perf: close PMD after benchmark run
>
> app/test-crypto-perf/main.c | 15 +++++++++++++--
> app/test/test_cryptodev.c | 6 +++++-
> 2 files changed, 18 insertions(+), 3 deletions(-)
>
> --
> 2.25.1
Series Acked-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
This patch adds closing of the PMD after running the tests. -- v3: * move the call from ut_teardown to testsuite_teardown v2: * display error message on close error Adam Dybkowski (2): test/crypto: close PMD after tests app/crypto-perf: close PMD after benchmark run app/test-crypto-perf/main.c | 15 +++++++++++++-- app/test/test_cryptodev.c | 5 +++++ 2 files changed, 18 insertions(+), 2 deletions(-) -- 2.25.1
This patch adds closing of the PMD after running the tests. Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com> --- app/test/test_cryptodev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index f91debc168..d68855c442 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -842,6 +842,7 @@ static void testsuite_teardown(void) { struct crypto_testsuite_params *ts_params = &testsuite_params; + int res; if (ts_params->mbuf_pool != NULL) { RTE_LOG(DEBUG, USER1, "CRYPTO_MBUFPOOL count %u\n", @@ -863,6 +864,10 @@ testsuite_teardown(void) rte_mempool_free(ts_params->session_mpool); ts_params->session_mpool = NULL; } + + res = rte_cryptodev_close(ts_params->valid_devs[0]); + if (res) + RTE_LOG(ERR, USER1, "Crypto device close error %d\n", res); } static int -- 2.25.1
This patch adds closing of the PMD after running the benchmark. Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com> --- app/test-crypto-perf/main.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c index 49af812d8b..70cb04a214 100644 --- a/app/test-crypto-perf/main.c +++ b/app/test-crypto-perf/main.c @@ -738,8 +738,13 @@ main(int argc, char **argv) } for (i = 0; i < nb_cryptodevs && - i < RTE_CRYPTO_MAX_DEVS; i++) + i < RTE_CRYPTO_MAX_DEVS; i++) { rte_cryptodev_stop(enabled_cdevs[i]); + ret = rte_cryptodev_close(enabled_cdevs[i]); + if (ret) + RTE_LOG(ERR, USER1, + "Crypto device close error %d\n", ret); + } free_test_vector(t_vec, &opts); @@ -758,8 +763,14 @@ main(int argc, char **argv) } for (i = 0; i < nb_cryptodevs && - i < RTE_CRYPTO_MAX_DEVS; i++) + i < RTE_CRYPTO_MAX_DEVS; i++) { rte_cryptodev_stop(enabled_cdevs[i]); + ret = rte_cryptodev_close(enabled_cdevs[i]); + if (ret) + RTE_LOG(ERR, USER1, + "Crypto device close error %d\n", ret); + + } rte_free(opts.imix_buffer_sizes); free_test_vector(t_vec, &opts); -- 2.25.1
> This patch adds closing of the PMD after running the tests.
>
> --
> v3:
> * move the call from ut_teardown to testsuite_teardown
Series Acked-by: Akhil Goyal <gakhil@marvell.com>
Applied to dpdk-next-crypto
Thanks.