From ee263a80fc69c9c2144f986961d5ded7543b31a4 Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Fri, 7 Jul 2017 18:39:03 +0800 Subject: [PATCH] vhost: Fix spdk_iommu_mem_unregister The function body uses VFIO_IOMMU_MAP_DMA which appears to be a copy&paste mistake, make it VFIO_IOMMU_UNMAP_DMA because we are doing the opposite of spdk_iommu_mem_register. Change-Id: If9f3b188178e71ff71221c77c1680b679fec1df0 Signed-off-by: Fam Zheng Reviewed-on: https://review.gerrithub.io/368551 Reviewed-by: Pawel Wodkowski Tested-by: SPDK Automated Test System Reviewed-by: Daniel Verkamp Reviewed-by: Jim Harris --- lib/vhost/vhost_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vhost/vhost_iommu.c b/lib/vhost/vhost_iommu.c index 24f943793..3a9ca8090 100644 --- a/lib/vhost/vhost_iommu.c +++ b/lib/vhost/vhost_iommu.c @@ -306,7 +306,7 @@ int spdk_iommu_mem_unregister(uint64_t addr, uint64_t len) int ret; pthread_mutex_lock(&vfio_cfg.map_lock); - ret = spdk_vfio_mem_op(addr, len, VFIO_IOMMU_MAP_DMA); + ret = spdk_vfio_mem_op(addr, len, VFIO_IOMMU_UNMAP_DMA); pthread_mutex_unlock(&vfio_cfg.map_lock); return ret; }