Welcome to MSDN Blogs Sign in | Join | Help

Pointless Blathering

Peter Wieland's thoughts on Windows driver development, and occasional rants about computing in general.
GetScatterGatherList will coallesce contiguous SG list entries

GregH asked me an interesting question at WinHEC today - one for which I didn't immediately know the answer.  He was wondering whether the new DMA DDIs (Get|PutScatterGatherList) would return a single SG entry for each page, or whether they would coallesce physically contiguous pages into a single entry.

The answer is that the coallescing is "kind of complex and probably won't happen in a way that will make complete sense to someone just looking at the generated [SG] lists".  To anyone who is familiar with the DMA DDIs that sort of answer probably isn't surprising :)

On X86 & for non-scatter-gather devices, the bounce buffers are allocated in big contiguous blocks and the DMA DDI will coallesce entries where possible.  Of course non-SG devices always get one big contiguous block no matter what, and so they'll only have a single entry.

On AMD64 the bounce buffers for an SG adapter aren't necessarily contiguous so there may be less coallescing.

Still, since you always have to plan for the worst case, this ends up being an optimization but shouldn't change your driver's behavior (unless your device uses single-page SG entries rather than address/length pairs).

Posted: Thursday, May 25, 2006 5:24 PM by PeterWie

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS