I/O Interfaces & Buses
Which statement is correct about DMA using a ring of descriptors in memory, as widely used by network cards and NVMe SSDs?
- AThe CPU transfers data by writing it byte by byte into device registers
- BThe CPU only writes addresses and lengths into descriptors and notifies the device, which reads them and carries out the transfers itself
- CDescriptors exist only inside the device and are invisible to the CPU
Show answer and explanation
Answer: B. The CPU only writes addresses and lengths into descriptors and notifies the device, which reads them and carries out the transfers itself
A descriptor ring is a table in main memory, used in a circular way, where each entry says which address to transfer and how many bytes. The CPU fills free descriptors and tells the device once, through a register, how far it has written. The device reads the descriptors by DMA, transfers the data and either marks finished descriptors as complete or writes completions to a separate completion ring (such as an NVMe completion queue). CPU and device can advance many transfers without waiting for each other.
- A. That is programmed I/O without DMA.
- B. Correct. Many transfers can be handed to the device at once.
- C. Descriptors usually live in main memory, read and written by both CPU and device.