Recently working on a PCI driver project and trying to understand the Scatter Gather DMA.

In my project, the PCI device(in a PC's PCI slot) is the DMA master and I want to do a DMA write to the PC's memory. For a scatter/gather dma, so PC driver should creat a linked list for those "non contiguous" or also called "segmented" physical memory, and write the first address of the linked list to the device. so the device's dma controler can do the write operation through the linked list without asking the PC for the next free memory block. am I write?

In the senario above, there is an expression "wrap around" envolved, and I can't be sure what does it mean.

Does it mean: the write pointer reached the end of the memory block?


the current data packet to be send is done sending and should start the next one ?


some other thing?

1 Answer 1


It can mean either of these as an alternative to scatter-gather DMA, depending on which documentation you are reading:

  • wraparound in a single memory buffer, e.g.,

    The physical representation of the data in memory depends on the HW co-processor. It can vary from one fixed place in memory, a fifo in memory with a start/end address and a wrap around, to a scatter-gather DMS that allows the data to be scattered in physical memory.

    For non-scatter/gather streams, data being transferred to/from the host system memory is stored in the host memory in a circular buffer which is constantly filled and drained. Hence, PCI transactions in this situation are burst transfers which range over a contiguous set of doubleword memory addresses, the DMA controller 208 requesting a new PCI transaction each time the position in the circular buffer wraps around to the starting address. The maximum size of these circular buffers is set at 2014 doublewords or one host page.

  • wraparound in a "ring" of memory buffers

    If the ring buffer is in free-running mode and the application cannot process data as fast as it is acquired, DMA will wrap around and overwrite the referenced buffer. The application must ensure that the data in the buffer is processed or copied out in time to prevent overrun.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .