On Thu, 20 Nov 2003, Jens Axboe wrote:

> Then you just cannot do zero-copy dma, if the buffer isn't aligned
> properly. It's as simple as that. And surely that wont kill you
> performance wise.
> 
> Doing bounce buffering to just maintain the use of mapping user pages
> into the kernel ls out right silly.
> 
> So no, I still don't think we have to add anything. Just don't do_dio if
> the alignment doesn't allow it. Ditto for sg.

The answer seems very simple.  There should be a host template entry for
dma buffer alignment (there's already a dma_boundary member).  It would be
copied into the device's request queue stucture if it is nonzero,
overriding the default value of 512.  sg and st should check the user
buffer against the request queue's dma_alignment mask and avoid doing
direct I/O if the alignment is wrong -- just fall back to normal I/O.

Any objections to this scheme?

Alan Stern



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to