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

Leon Romanovsky
2024-07-17T08:47:21Z

On Wed, Jul 17, 2024 at 10:21:45AM +0200, Christoph Hellwig wrote:
> dma_is_default_iommu still looks a bit odd to me - basically we have
> the ops structure just to say to bypass it. Why not add a single-bit
> dma_iommu field to struct device next to dma_ops_bypass to skip it?

It will cause to the situation where "struct device" memory footprint
will increase, while we still need to keep dma_ops for archs that don't
want to use default IOMMU.

Because dma_ops pointer exists anyway and has already specific flags. I
decided to take evolutive approach and add a new flag to it, instead of
revolutionary approach and add a new field to struct device.

> Then IOMMU_DMA also does not need to select DMA_OPS any more, which
> would be kinda silly with the direct calls.

I didn't know how far to go with that, as default IOMMU .flags are
unique and can be removed if dma_iommu bit is set.

Thanks