Device addresses need not equal CPU addresses
CPU virtual addresses, physical addresses and device DMA addresses can differ. An IOMMU or host bridge can translate device addresses, so handing hardware an ordinary CPU pointer does not establish access to the same buffer.
Linux DMA mapping interfaces return a device-usable address under the device’s addressing capabilities. Mapping can fail or face restrictions. Allocating CPU memory, mapping it, starting a transfer and confirming completion are separate steps.
References: [1]
Transferring buffer ownership
Linux distinguishes coherent mappings, useful for structures such as descriptor rings, from streaming mappings typically associated with transfers or a use period. Transfer direction describes data movement between memory and the device and informs required handling.
Reusing a streaming buffer requires appropriate synchronization when handing it between CPU and device, and eventually unmapping it. A completion indication does not erase platform cache requirements or permit freeing memory still in use.
References: [1]
Coherence does not automatically order accesses
Even coherent DMA memory can require ordering between fields. Publishing a descriptor’s valid flag must not expose it before its address and other contents are ready; suitable barriers and the device protocol still matter.
DMA removes item-by-item CPU copying without eliminating descriptor preparation, error handling, allocation or handoff costs. Its value depends on transfer size, mapping and synchronization overhead and device capabilities, rather than an absence of CPU work.