Re: [PATCH 2/2] dma: Add IOMMU static calls with clear default ops

Leon Romanovsky
2024-07-13T09:33:04Z

On Sat, Jul 13, 2024 at 07:18:13AM +0200, Christoph Hellwig wrote:
> On Fri, Jul 12, 2024 at 03:21:55PM +0100, Robin Murphy wrote:
> >> This is done to keep layering similar to existing in DMA subsystem. We
> >> have special files and calls to dma-direct, it looks natural to have
> >> special files and call to dma-iommu. It is not nice to call to drivers/iommu
> >> from kernel/dma/mapping.c
> >
> > That's where I firmly disagree. In the DMA API aspect, iommu-dma is exactly
> > a peer of dma-direct,
>
> Exactly.
>
> > however it lives in drivers/iommu for practical
> > reasons because it's more closely coupled to IOMMU API internals in all
> > other aspects of its implementation.
>
> TBH I think kernel/dma/ would be the better place. But that's really the
> least my concernes at the moment.
>
> But the important point is that I would really prefer to avoid another
> magic layer - just do direct calls like for dma-direct to keep it
> understandable (and probably faster).

I'll change my patch to be without extra layer, but is it unlikely that
it will make any difference in performance.

Thanks

>