2009/3/12 Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>: > On Wed, 11 Mar 2009, Stefan Bruens wrote: > >> Hi, >> >> I have some questions regarding latency for USB packets. After having read the >> USB 2.0 specification and the Intel EHCI specification (v1.0), I have come to >> the following conclusions: >> >> Assuming a device with 1 IN and 1 OUT endpoint (bulk), directly connected to >> the USB root hub, no other devices on the same port. Fixed package size of 512 >> bytes (in and out). IN packets are generated at a constant rate of about 4 >> packets per microframe, OUT packets are generated as bursts of variable size. It seems a little odd. The bulk in performance in your ehci can only reach 16MB/sec (512*4*8*1024B/s) if IN packets are generated at a constant rate of about 4 packets per microframe. In fact, bulk in transfer of ehci is much better than 16MB/s. Maybe you submit bulk IN and OUT URBs at the same time and come to the conclusion. >> URBs for IN and OUT are 512 bytes each (single USB packet). >> >> I would be very grateful if anyone confirmed or turned down the following >> statements: >> >> 1. transactions for IN and OUT will be scheduled round robin, given there are >> any OUT packets in the queue > > Yes. > >> 2. the device will be polled for available IN data by the host every >> AsyncSchedSleepTime interval (10us, see EHCI spec 4.8.4) > > More or less. The NakCnt field is involved too. > >> 3. OUT packets will be transmitted immediately when they are available (given >> no other ongoing transaction, device has available space (PING->ACK)) > > OUT packets are also subject to the AsyncSchedSleepTime delay. > >> 4. an interrupt will only be generated by the EHCI controller once every >> microframe (when interrupt on completion is set), introducing a latency of up >> to 125 us. Interrupt latency is controlled by the Interrupt Threshold Control field in the USBCMD register. The Interrupt Threshold is 8uframe at default, so can introduce a latency of up to 1ms. (see EHCI spec 4.15) > > Yes. > -- Lei Ming -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html