[v2,1/2] test/crypto: close PMD after tests

Message ID 20210308125708.31525-2-adamx.dybkowski@intel.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series test/crypto: close PMD after tests |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Dybkowski, AdamX March 8, 2021, 12:57 p.m. UTC
  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(-)
  

Patch

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