app/crypto-perf: close device after benchmark run
authorAdam Dybkowski <adamx.dybkowski@intel.com>
Fri, 9 Apr 2021 12:13:01 +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 benchmark.

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

index 49af812..70cb04a 100644 (file)
@@ -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 @@ err:
        }
 
        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);