diff --git a/examples/vhost/main.c b/examples/vhost/main.c index ac78704d79..42e53a0f9a 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -2066,6 +2066,14 @@ main(int argc, char *argv[]) RTE_LCORE_FOREACH_WORKER(lcore_id) rte_eal_wait_lcore(lcore_id); + for (i = 0; i < dma_count; i++) { + if (rte_vhost_async_dma_unconfigure(dmas_id[i], 0) < 0) { + RTE_LOG(ERR, VHOST_PORT, + "Failed to unconfigure DMA %d in vhost.\n", dmas_id[i]); + rte_exit(EXIT_FAILURE, "Cannot use given DMA device\n"); + } + } + /* clean up the EAL */ rte_eal_cleanup();