Re: some questions about bandwidth calculation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 7 Feb 2014, vichy wrote:

> Hi Alan:
> 
> 2014-01-31 2:23 GMT+08:00 Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>:
> > On Fri, 31 Jan 2014, vichy wrote:
> >
> >> Hi all:
> >> I have some questions about bandwidth calculation
> >> 1. why tt time need to include one maxp bus time ?
> >>             qh->tt_usecs = NS_TO_US (think_time +
> >>                     usb_calc_bus_time (urb->dev->speed,
> >>                     is_input, 0, max_packet (maxp)));
> >
> > Because tt_usecs is the time required to send a maximum-size packet.
> > So of course you have to include the maxp bus time.
> is it the requirement defined in spec?
> if so, would you please tell me where I can find it?

Section 11.18.2 (last paragraph on p. 373):

	The host always uses the maximum data payload size for a 
	full-/low-speed endpoint in doing its budgeting.

> >> 3. below is the fomula to calculate bus time
> >> Full-speed (Input)
> >> Non-Isochronous Transfer (Handshake Included)
> >> = 9107 + (83.54 * Floor(3.167 + BitStuffTime(Data_bc))) + Host_Delay
> >> what is 9107 and 3.167 used for?
> >> (9102 is not equal to FS bit time * FS protocol overhead)
> >
> > 9107 is the overhead.  It includes things like inter-packet delays, the
> > IN or OUT token packet, the ACK packet, and so on.
> in spec I only find the formula, but spec didn't tell where this 9107 come from?

No, it doesn't.  And in fact, the values in the spec are wrong because 
they don't take into account the delays caused by intermediate hubs.

> take Full buck for example, which is non-iso, the protocol overhead is
> only 13Bytes.

What do you mean by "Full buck"?

For each packet (token, data, and handshake), the overhead includes
inter-packet delay, cable delay, SYNC, bit-stuffing, and End-Of-Packet
-- all in addition to the PID, token, and CRC bytes.

I don't know where you got that "13" from.  If you assume the
inter-packet delays always require 1 byte time and count up the
inter-packet delays (3), SYNCs (3), token bytes (3), PID and CRC hytes
(3), and handshake (1), that adds up to 13 bytes of protocol overhead.  
But it leaves out cable delay, bit-stuffing, and End-Of-Packet signals.

You also have to remember that the spec allows the clock rate on
Full-Speed devices to vary by up to 0.25% of the nominal rate.

Alan Stern

--
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




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux