[5/5] examples/dma: fix missing dma close
Checks
Commit Message
The application stops all dmadevs that it used but never closed any,
meaning device cleanup was not done.
This patch adds device cleanup for all dmadevs. All devices need to be
closed for completeness, since devices not used by the application may
also have been created during PCI probe of EAL init.
Fixes: d047310407a3 ("examples/ioat: port application to dmadev API")
Cc: stable@dpdk.org
Cc: bruce.richardson@intel.com
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
---
examples/dma/dmafwd.c | 6 ++++++
1 file changed, 6 insertions(+)
@@ -1097,6 +1097,12 @@ main(int argc, char **argv)
rte_ring_free(cfg.ports[i].rx_to_tx_ring);
}
+ /* close all dmadevs */
+ RTE_DMA_FOREACH_DEV(i) {
+ printf("Closing dmadev %d\n", i);
+ rte_dma_close(i);
+ }
+
/* clean up the EAL */
rte_eal_cleanup();