On Thu, 7 Jul 2005, Jason Flynn G7OCD wrote: > Hi all, > I'm new to USB so I thought I'd dip my toe in > the water via usbfs. I'm trying to send a range > of buffer sizes using bulk transfers. When > submitting lots of very small buffers (64 byte > up to about 1k) I'm finding that the fastest > rate I can submit is about 325 per second. > Just to check that I was sure about the 3ms > delay being cause by the submit ioctl I did > something like this: > > create 4000 small empty buffers/urbs OUT > for x 1 to 4000 > { > ioctl(submit,buffer(x)) > } > reap all and free all > > I'm using a late-ish 2.4 kernel with UHCI > and setting the BULK_QUEUE flag. > I did try briefly with EHCI and it was quite > a bit faster (but not sure how much, will try > today) but my target may not have EHCI. > > Is this likely to be performance limitation > of usbfs (forcing me to move to a kernel > module) or should I be able to call in from > user-land faster than that. i.e. should the > ioctl return faster than 3ms ? > Or is it some odd queuing or timing thing > inherent in UHCI?
Full-speed USB (not just UHCI!) definitely has limitations. Its maximum theoretical transfer rate for bulk data is 19 64-byte buffers per ms, or 1187 KB/s. Real transfers tend to max out around 800 KB/s. To get the best performance out of usbfs, you should submit large buffers, not small ones (say up to 16 or 32 KB). That will minimize overhead and ioctl latencies. When you use this approach you should be able to realize the maximum hardware performance. Alan Stern ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel