On Monday 06 February 2006 8:24 am, Badari Pulavarty wrote: > To give you little context here.. > > Zach Brown proposed vectored AIO interfaces and support. He added > aio_readv/aio_writev file-operations to support this. Christoph Hellwig > pointed out that, we are adding yet another file-op and proposed to > cleanup file-ops and collapse aio_read/aio_readv/readv into a single > file-op which is aio_read() to support all of those. > > http://marc.theaimsgroup.com/?l=linux-kernel&m=113097423105516&w=2
OK, that context is useful; thanks. Although as Alan and I discussed later, in reference to Zach's observation that "This is of particular use with O_DIRECT when the iovecs are pushed all the way down to devices which are capable of scatter-gather DMA" ... some USB-specific issues complicate things. Packet boundaries are protocol-visible, so two iovecs for bulk endpoints, like > > > A: 100 bytes at addr1, 512 bytes at addr2 > > > B: 512 bytes at addr2, 100 bytes at addr2 will require different treatment ... only B could ever be implemented as zerocopy with O_DIRECT. (And that would require many updates to the gadgetfs code, which is currently implemented as always-copy for simplicity.) > If usb/gadget never be called to handle more than a single vector, > my original (attached) patch would be good enough. But if it need > to support more vectors, I am not sure whats the best way to support > it. Do what I said later: >> The simple way to meet Badari's current goal is: calculate the length >> of the whole iovec, use that to allocate the right size i/o buffer, then >> have the AIO write path gather data into that, and the AIO read "retry" >> path scatter data out of it after reads complete. IMO it's never reasonable to have a BUG_ON() for a perfectly legitimate syscall parameter set (iovec len > 1). - Dave ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel