diff mbox series

[v1,2/2] example/vhost: unconfigure DMA vchannel

Message ID 20220814140442.82525-3-xuan.ding@intel.com (mailing list archive)
State Superseded
Delegated to: Maxime Coquelin
Headers show
Series vhost: introduce DMA vchannel unconfiguration | expand


Context Check Description
ci/intel-Testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing fail Testing issues
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Ding, Xuan Aug. 14, 2022, 2:04 p.m. UTC
From: Xuan Ding <xuan.ding@intel.com>

This patch uses rte_vhost_async_dma_unconfigure() API
to manually free 'dma_coy_track' array rather than wait for
the program to finish before being freed.

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
 examples/vhost/main.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series


diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 7e1666f42a..1dba9724c2 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -2060,6 +2060,13 @@  main(int argc, char *argv[])
+	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 in vhost.\n");
+			rte_exit(EXIT_FAILURE, "Cannot use given DMA device\n");
+		}
+	}
 	/* clean up the EAL */