Re: [PATCH 2/4] dma-iommu: Add iommu_dma_opt_mapping_size()

2022-05-23 Thread Damien Le Moal via iommu
On 2022/05/20 17:23, John Garry wrote: > Add the IOMMU callback for DMA mapping API dma_opt_mapping_size(), which > allows the drivers to know the optimal mapping limit and thus limit the > requested IOVA lengths. > > This value is based on the IOVA rcache range limit, as IOVAs allocated > above

Re: [PATCH 2/4] dma-iommu: Add iommu_dma_opt_mapping_size()

2022-05-23 Thread Damien Le Moal via iommu
On 2022/05/23 16:01, John Garry wrote: > On 21/05/2022 00:33, Damien Le Moal wrote: > > Hi Damien, > >>> +unsigned long iova_rcache_range(void) >> Why not a size_t return type ? > > The IOVA code generally uses unsigned long for size/range while > dam-iommu uses size_t as appropiate, so I'm

Re: [PATCH 2/4] dma-iommu: Add iommu_dma_opt_mapping_size()

2022-05-23 Thread John Garry via iommu
On 21/05/2022 00:33, Damien Le Moal wrote: Hi Damien, +unsigned long iova_rcache_range(void) Why not a size_t return type ? The IOVA code generally uses unsigned long for size/range while dam-iommu uses size_t as appropiate, so I'm just sticking to that. +{ + return PAGE_SIZE <<

Re: [PATCH 2/4] dma-iommu: Add iommu_dma_opt_mapping_size()

2022-05-20 Thread Damien Le Moal via iommu
On 5/20/22 17:23, John Garry wrote: > Add the IOMMU callback for DMA mapping API dma_opt_mapping_size(), which > allows the drivers to know the optimal mapping limit and thus limit the > requested IOVA lengths. > > This value is based on the IOVA rcache range limit, as IOVAs allocated > above

[PATCH 2/4] dma-iommu: Add iommu_dma_opt_mapping_size()

2022-05-20 Thread John Garry via iommu
Add the IOMMU callback for DMA mapping API dma_opt_mapping_size(), which allows the drivers to know the optimal mapping limit and thus limit the requested IOVA lengths. This value is based on the IOVA rcache range limit, as IOVAs allocated above this limit must always be newly allocated, which