[Cake] overheads or rate calculation changed?

Jonathan Morton chromatix99 at gmail.com
Sat Jan 6 15:44:23 EST 2018


> On 23 Dec, 2017, at 11:03 pm, Sebastian Moeller <moeller0 at gmx.de> wrote:
> 
> just had a look for hard_header_len in the linux kernel:
> linux/include/linux/netdevice.h:
> *      @hard_header_len: Maximum hardware header length.
> *      @min_header_len:  Minimum hardware header length
> 
> this seems to corroborate our observation that hard_header_len is not a veridical representation of the actual hardware header length, so I assume the values cake returns are actually true. It also indicates that except for pure ethernet interfaces hard_header_len is _not_ the right parameter to evaluate for what cake is evaluating it for...

Turns out min_header_len is always either zero or 14, and is scarcely used anywhere.  It seems to be completely ignored by non-Ethernet interfaces.

However, it appears that the correct value is stored implicitly in each skb, and can be obtained through skb_network_offset(skb) - that's the offset from the beginning of the packet to the IP header (assuming it's an IP packet).  This suggests to me that the via-ethernet keyword can be retired, in favour of unconditionally subtracting that value from each packet length before applying overhead compensation, and setting the *default* overhead compensation to hard_header_len (to emulate the current default behaviour).

What we would lose that way is the present capability to add an overhead to the raw packet length as reported by Linux.  However, since that doesn't reliably correspond to an actual packet length on the wire, that's not really a useful capability to keep, except for direct comparison with other overhead compensation methods.

Comments?

 - Jonathan Morton



More information about the Cake mailing list