test/crypto: close device after tests
authorAdam Dybkowski <adamx.dybkowski@intel.com>
Fri, 9 Apr 2021 12:13:00 +0000 (13:13 +0100)
committerAkhil Goyal <gakhil@marvell.com>
Fri, 16 Apr 2021 10:43:33 +0000 (12:43 +0200)
This patch adds closing of the PMD after running the tests.

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
app/test/test_cryptodev.c

index f91debc..d68855c 100644 (file)
@@ -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