[Bloat] tc linklayer ADSL calc broken after commit 56b765b79 (htb: improved accuracy at high rates)

Steinar H. Gunderson sgunderson at bigfoot.com
Thu May 30 05:52:53 EDT 2013


On Thu, May 30, 2013 at 11:15:47AM +0200, Jesper Dangaard Brouer wrote:
>  int pkt_len = skb->len + (encap_overhead * gso_segments);
>  int wire_sz = DIV_ROUND_UP(pkt_len,48)*53;
> 
> (I suspect, that the compiler might even optimize and remove any
> real divisions, I bet Eric can tell us.)

FWIW, GCC can change divisions by integer constants (even signed divisions)
to some multiplies and shifts, by way of some number theory magic.

/* Steinar */
-- 
Homepage: http://www.sesse.net/



More information about the Bloat mailing list