[dpdk-dev,4/4] vfio: do not needlessly check for IOVA mode

Message ID dff6aa2c058a0d7a427b844b1b5f5fd0267fa42f.1522585461.git.anatoly.burakov@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Anatoly Burakov April 1, 2018, 12:26 p.m. UTC
  Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/linuxapp/eal/eal_vfio.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
  

Comments

Thomas Monjalon April 2, 2018, 4:29 p.m. UTC | #1
01/04/2018 14:26, Anatoly Burakov:
> Cc: stable@dpdk.org
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>

It deserves an explanation.

Please Anatoly, think about commit explanations more often.
  
Anatoly Burakov April 2, 2018, 5:12 p.m. UTC | #2
On 02-Apr-18 5:29 PM, Thomas Monjalon wrote:
> 01/04/2018 14:26, Anatoly Burakov:
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> 
> It deserves an explanation.
> 
> Please Anatoly, think about commit explanations more often.
> 

I was under the impression that from context of previous patches, it 
would be obvious?

But OK, i'll respin.
  
Thomas Monjalon April 2, 2018, 7:55 p.m. UTC | #3
02/04/2018 19:12, Burakov, Anatoly:
> On 02-Apr-18 5:29 PM, Thomas Monjalon wrote:
> > 01/04/2018 14:26, Anatoly Burakov:
> >> Cc: stable@dpdk.org
> >>
> >> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> > 
> > It deserves an explanation.
> > 
> > Please Anatoly, think about commit explanations more often.
> > 
> 
> I was under the impression that from context of previous patches, it 
> would be obvious?

When we'll check this file in the git history, the context
of previous patch won't be so useful.

> But OK, i'll respin.

Thanks, it's important to consider each patch individually.
  

Patch

diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
index e44ae4d..2421d51 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
@@ -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;