[4/5] app/testpmd: stop and close dmadevs at exit
Checks
Commit Message
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.laatz@intel.com>
---
app/test-pmd/testpmd.c | 9 +++++++++
1 file changed, 9 insertions(+)
Comments
On Fri, Apr 08, 2022 at 03:15:03PM +0100, Kevin Laatz wrote:
> 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.laatz@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>
This addition triggers a build error for me, as the header is not found.
Does dmadev need to be added as a testpmd dependency in this case?
@@ -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) {