Re: [PATCH v6 5/8] iommu: Add bounce page APIs

2019-08-17 Thread Lu Baolu
Hi, On 8/16/19 12:46 PM, Christoph Hellwig wrote: On Fri, Aug 16, 2019 at 10:45:13AM +0800, Lu Baolu wrote: Okay. I understand that adding these APIs in iommu.c is not a good idea. And, I also don't think merging the bounce buffer implementation into iommu_map() is feasible since iommu_map()

Re: [PATCH v6 5/8] iommu: Add bounce page APIs

2019-08-15 Thread Christoph Hellwig
On Fri, Aug 16, 2019 at 10:45:13AM +0800, Lu Baolu wrote: > Okay. I understand that adding these APIs in iommu.c is not a good idea. > And, I also don't think merging the bounce buffer implementation into > iommu_map() is feasible since iommu_map() is not DMA API centric. > > The bounce buffer

Re: [PATCH v6 5/8] iommu: Add bounce page APIs

2019-08-15 Thread Lu Baolu
Hi Joerg, On 8/15/19 11:48 PM, Joerg Roedel wrote: On Thu, Aug 15, 2019 at 02:15:32PM +0800, Lu Baolu wrote: iommu_map/unmap() APIs haven't parameters for dma direction and attributions. These parameters are elementary for DMA APIs. Say, after map, if the dma direction is TO_DEVICE and a

Re: [PATCH v6 5/8] iommu: Add bounce page APIs

2019-08-15 Thread Joerg Roedel
On Thu, Aug 15, 2019 at 02:15:32PM +0800, Lu Baolu wrote: > iommu_map/unmap() APIs haven't parameters for dma direction and > attributions. These parameters are elementary for DMA APIs. Say, > after map, if the dma direction is TO_DEVICE and a bounce buffer is > used, we must sync the data from

Re: [PATCH v6 5/8] iommu: Add bounce page APIs

2019-08-15 Thread Lu Baolu
Hi Joerg, On 8/14/19 4:38 PM, Joerg Roedel wrote: Hi Lu Baolu, On Tue, Jul 30, 2019 at 12:52:26PM +0800, Lu Baolu wrote: * iommu_bounce_map(dev, addr, paddr, size, dir, attrs) - Map a buffer start at DMA address @addr in bounce page manner. For buffer parts that doesn't cross a whole

Re: [PATCH v6 5/8] iommu: Add bounce page APIs

2019-08-14 Thread Joerg Roedel
Hi Lu Baolu, On Tue, Jul 30, 2019 at 12:52:26PM +0800, Lu Baolu wrote: > * iommu_bounce_map(dev, addr, paddr, size, dir, attrs) > - Map a buffer start at DMA address @addr in bounce page > manner. For buffer parts that doesn't cross a whole > minimal IOMMU page, the bounce page policy