How DMA and PCIe play together?
Asked Answered
I

1

5

in a PCIe configuration, devices have dedicated addresses and they send data in Peer-to-Peer mode to each other - every device can write when it wills and the switches take care to correctly pass data forward. There is no need to have a "bus master", which decides when and how data will be transmitted.

How does DMA come into play in such configuration? For me it seems that DMA is an outdated feature, which is not needed in a PCIe configuration. Every device can send data to the main memory, or read from it - obviously the main memory will always be the "slave" in such operations.

Or is there some other functionality of DMA, which I am missing?

Thank you in advance!

Inhume answered 18/11, 2018 at 13:40 Comment(2)
When a PCI device reads or writes main memory, that is DMA.Foal
Sometimes a PCI device is called a “DMA engine” when reading/writing main memory is its only purpose, for example en.wikipedia.org/wiki/I/O_Acceleration_Technology.Foal
B
7

When a device other than a CPU accesses memory that is attached to a CPU, this is called direct memory access (DMA). So any PCIe read or write requests issued from PCIe devices constitute DMA operations. This can be extended with 'device to device' or 'peer to peer' DMA where devices perform reads and writes against each other without involving the CPU or system memory.

There are two main advantages of DMA: First, DMA operations can move data into and out of memory with minimal CPU load, improving software efficiency. Second, the CPU can only issue reads and writes of whatever the CPU word size is, which results in very poor throughput over the PCIe bus due to TLP headers and other protocol overheads. Devices directly issuing read and write requests can issue read and write operations with much larger payloads, resulting in higher throughput and more efficient use of the bus bandwidth.

So, DMA is absolutely not obsolete or outdated - basically all high-performance devices connected over PCIe will use DMA to use the bus efficiently.

Buckwheat answered 16/7, 2019 at 23:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.