英文:
Understanding the meaning of "DMA" in Linux DMA buf (dmabuf)
问题
我正在寻求关于Linux DMA缓冲区(dmabuf)中“DMA”含义的澄清。在dmabuf中的“DMA”是否直接与硬件DMA外设相关?
英文:
I'm seeking clarification regarding the meaning of "DMA" in the context of Linux DMA buf (dmabuf). Does "DMA" in dmabuf directly relate to the hardware DMA peripheral?
答案1
得分: 2
DMA意味着另一个单元(不是CPU)也会访问内存区域。通常情况下,这是一个PCI(e)设备。现代网络适配器的每个驱动程序都会使用DMA来减轻CPU负载。CPU将在内存中准备一个环形缓冲区以传输数据,而NIC将从内存中读取下一个数据包,而不需要CPU使用率。对于接收,CPU会准备一个接收环形缓冲区,NIC会将接收到的数据传输到内存中,并在接收到数据包后触发中断。内存必须是DMA一致的。MMU中的TLB需要针对这个内存区域进行特殊设置。
参见:
https://www.kernel.org/doc/Documentation/DMA-API-HOWTO.txt
英文:
DMA means, that another unit ( not the cpu ) will also access a memory area.
This is normally a pci(e) device.
Every driver for a modern network adapter will use DMA to reduce the CPU load.
The CPU will prepare a ring buffer in memory to transmit data and the NIC will read the next data packet from the memory without CPU usage. For receive a receive ring buffer is prepared by the CPU and the NIC will transfer receive data to the memory and fire a interrupt after receiving a packet.
The memory hast to be DMA coherent. The TLB in the MMU needs a special setup for this memory area.
see:
https://www.kernel.org/doc/Documentation/DMA-API-HOWTO.txt
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论