Re: Bulkusb.sys performance by Tim
Tim
Sat Feb 02 16:29:41 CST 2008
xxx <anshul.solanki@gmail.com> wrote:
>please clarify this also
>
>>>
>2) so this WriteFile() i am requesting 50K bytes to be written, hence
>there is always data to be sent. Hence driver should load bus, but i
>see in CATC that between two SOF only single packet of 512 is sent.
>>>
>
>Why is sending of 50 , 1K packets ( i.e. pending multiple URB) more
>efficient than sending just one 50K packet to bulkusb.sys driver
What you send to bulkusb.sys is not so important. What is important is
what bulkusb.sys sends to the host controller. Remember that USB is a
"scheduled" bus: the host controller schedules all of the transactions in
advance, and the transactions get committed once the frame starts.
When you send down a single 50K read, that gets chopped into 97 USB
requests of 512 bytes each. That will just about fill one frame (8
microframes, 1 millisecond). The host controller will schedule them out
across one frame.
But by the time that request finishes, the host controller is already
scheduling the NEXT frame. If you don't have another request waiting in
the wings, you won't get a shot. The frame will go on without you, and you
will lose an entire millisecond.
Also, if your hardware should ever send a short packet (less than 512
bytes), the entire 50k transfer will be completed back to you. Again,
unless you have another request already waiting, you will miss the rest of
that frame.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.