[Cake] Long-RTT broken again

Sebastian Moeller moeller0 at gmx.de
Sat Nov 7 10:08:29 EST 2015


Hi Jonathan,

pretty cool, ans subtle ;)

On Nov 7, 2015, at 11:51 , Jonathan Morton <chromatix99 at gmail.com> wrote:

> Okay, I’ve tracked down the problem.  Turns out to be one of C’s more subtle misfeatures.
> 
> I calculate the desired buffer size as rate * interval * 4.  Since interval is in µs, rate * interval is a 64-bit temporary.  However, I forgot to cast either of these operands to the new width first, so the upper half of the product was never calculated.  After dividing by 250000, the resulting buffer size was 8918 bytes - which was clamped up to 64KB by a sanity check immediately afterwards.
> 
> It’s thus remarkable that we got as much throughput as we did.
> 
> While fixing this, I’m also adding configurability of the buffer limit and statistics of how much of the buffer was actually ever used.  Additionally, I’m choosing a saner default for “unlimited” mode.

	Oh, shiny ;) I take it the parameter is limiting the queue memory as measured by skb->truesize ; just checked, it wants the size in KB. I just committed a change to report that in the usage help tc will display…

Best Regards
	Sebastian

> 
> - Jonathan Morton
> 




More information about the Cake mailing list