Here is my answer to your questions:
Why does a IO device(NIC/SSD) need a IO page table for DMA?
An IO device does not necessarily need an IO page table. If the system supports IOMMU with Shared Virtual Addressing (SVA), the device can use a process's page table environment instead. This allows DMA operations to use virtual addresses (VA) directly instead of requiring IO virtual addresses (IOVA). For more details, refer to the article 'Shared Virtual Addressing for IOMMU': https://lwn.net/Articles/747230/.
If the IOVA is used only once and is not reused after a single DMA transfer, then is it really necessary to manage the IOVA-PA mapping through a page table?
The IO page table is used by IOMMU hardware to translate IOVA to physical addresses (PA). The IO page table is managed by the operating system, not by individual processes. It means IO page table is a shared resource. Even if the IOVA is used only once, the page table ensures hardware-level address translation and isolation, which are critical for system security and performance.
Is it possible that a single DMA operation uses the IOVA multiple times?
Yes, a single DMA operation can use the same IOVA multiple times. However, this is not recommended due to potential performance overheads and complexity in managing the mapping.
My proposal:
If you prefer to avoid using an IO page table, consider using Shared Virtual Addressing (SVA), which allows DMA operations to leverage process-level virtual addresses without the need for IOVA.