Re: USB short packets and physical data packet length



brad@xxxxxxxxxxx wrote:

In other words, if we define a bulk endpoint as 512-bytes, is it
wastefull of bandwidth if the endpoint is also used for transfers
that are all alwyas very much smaller than this maximum packet size?

Is it more bandwidth efficient to simply define a second endpoint with a smaller wMaxPacketSize?

IIUC, USB transfers are organised as transactions in a microframe. The USB host arbiter will allocate timeslots for transactions based on the pipe type, maximum packet size of each pipe and the availability of data.

So yes, IIUC a pipe with max=512 will always occupy a timeslot equivalent to a packet of 512 bytes, regardless of the number of bytes in the packet (not being familiar with the physical line protocol, I'm not sure you can say that it's "padded" at all, but this is completely irrelevant from a software POV).

The corollary is that a smaller *max* packet size will free up more of the microframe for other transfers.

That's my understanding - happy to be corrected.

Regards,

--
Mark McDougall, Engineer
Virtual Logic Pty Ltd, <http://www.vl.com.au>
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266
.



Relevant Pages

  • Re: USB short packets and physical data packet length
    ... Interrupt endpoints, but not for Bulk or Control. ... or Control transfers are pending. ... During actual transfers, no reservation ... no packet is waiting, there is no slot reserved as these transfes are ...
    (comp.arch.embedded)
  • Re: Bug in usbser.sys?
    ... "Philip Lukidis" wrote in message ... > transfers, please give me an indication of how to setup a multi-packet ... > transfer where one packet would not be of the same size (and this ideally ... > to simply be less than the maximum packet size? ...
    (microsoft.public.development.device.drivers)
  • Re: Bug in usbser.sys?
    ... This posting is provided "AS IS" with no warranties, and confers no rights. ... "Philip Lukidis" wrote in message ... >> transfers, please give me an indication of how to setup a multi-packet ... Would the final packet in my buffer ...
    (microsoft.public.development.device.drivers)
  • Re: USB short packets and physical data packet length
    ... Interrupt endpoints, the bandwidth is only reserved in each ... a "timeslot" doing nothing when Bulk or Control transfers are pending. ... I understand that if no packet is waiting, there is no slot reserved as these transfes are "on demand" and dynamically allocated, but I'd be very surprised if the USB arbiter worked on actual packet sizes and not max paxket lengths??? ... My argument was that small packet size would be more bandwidth efficient over a large packet size where the actual number of bytes was *always* smaller. ...
    (comp.arch.embedded)
  • Re: Bug in usbser.sys?
    ... I was just wondering if this holds true for all USB transfers types ... I/O request with a buffer of size 10*wMaxPacketSize, and say on the USB the ... how I can perform a transfer with different packet sizes in one I/O ...
    (microsoft.public.development.device.drivers)