理解Linux DMA buf(dmabuf)中"DMA"的含义。

huangapple go评论54阅读模式
英文:

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

huangapple
  • 本文由 发表于 2023年6月16日 14:14:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/76487388.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定