DMA devices are created during PCI probe in EAL init. In order to
perform cleanup for those devices, they need to be stopped and closed.
This patch adds the necessary cleanup to ensure clean exit.

Signed-off-by: Kevin Laatz <kevin.la...@intel.com>
---
 app/test-pmd/testpmd.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index fe2ce19f99..438749c5b8 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -45,6 +45,7 @@
 #include <rte_pci.h>
 #include <rte_ether.h>
 #include <rte_ethdev.h>
+#include <rte_dmadev.h>
 #include <rte_dev.h>
 #include <rte_string_fns.h>
 #ifdef RTE_NET_IXGBE
@@ -3402,6 +3403,14 @@ pmd_test_exit(void)
                }
        }
 
+       /* stop and close all dmadevs */
+       RTE_DMA_FOREACH_DEV(i) {
+               printf("\nStopping and closing dmadev %d...\n", i);
+               fflush(stdout);
+               rte_dma_stop(i);
+               rte_dma_close(i);
+       }
+
        if (hot_plug) {
                ret = rte_dev_event_monitor_stop();
                if (ret) {
-- 
2.31.1

Reply via email to