vfio: do not needlessly check for IOVA mode
authorAnatoly Burakov <anatoly.burakov@intel.com>
Wed, 4 Apr 2018 14:40:47 +0000 (15:40 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 11 Apr 2018 00:18:19 +0000 (02:18 +0200)
We already set IOVA addresses of memsegs and memzones to VA
address during initialization, so we don't need to check
whether we're in RTE_IOVA_VA mode anywhere else.

Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
lib/librte_eal/linuxapp/eal/eal_vfio.c

index e44ae4d..2421d51 100644 (file)
@@ -681,10 +681,7 @@ vfio_type1_dma_map(int vfio_container_fd)
                dma_map.argsz = sizeof(struct vfio_iommu_type1_dma_map);
                dma_map.vaddr = ms[i].addr_64;
                dma_map.size = ms[i].len;
-               if (rte_eal_iova_mode() == RTE_IOVA_VA)
-                       dma_map.iova = dma_map.vaddr;
-               else
-                       dma_map.iova = ms[i].iova;
+               dma_map.iova = ms[i].iova;
                dma_map.flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE;
 
                ret = ioctl(vfio_container_fd, VFIO_IOMMU_MAP_DMA, &dma_map);
@@ -784,10 +781,7 @@ vfio_spapr_dma_map(int vfio_container_fd)
                dma_map.argsz = sizeof(struct vfio_iommu_type1_dma_map);
                dma_map.vaddr = ms[i].addr_64;
                dma_map.size = ms[i].len;
-               if (rte_eal_iova_mode() == RTE_IOVA_VA)
-                       dma_map.iova = dma_map.vaddr;
-               else
-                       dma_map.iova = ms[i].iova;
+               dma_map.iova = ms[i].iova;
                dma_map.flags = VFIO_DMA_MAP_FLAG_READ |
                                 VFIO_DMA_MAP_FLAG_WRITE;