On Mon, 2016-08-29 at 15:51 -0300, Marcelo Ricardo Leitner wrote: > skb->truesize = SKB_TRUESIZE(skb_end_offset(skb)); > > Shouldn't __pskb_pull_tail() already fix this? As it seems the expected > behavior and it would have a more global effect then. For drivers not > using copybreak, that's needed here anyway, but maybe this help other > protocols/situations too.
That would be difficult, because some callers do their own truesize tacking (skb might be attached/charged to a socket, so changing skb->truesize would need to adjust the amount that was charged) This is why pskb_expand_head() is not allowed to mess with skb->truesize (but in the opposite way, since we probably are increasing skb->truesize) Not sure it is worth the pain in fast path, where packets are consumed so fast that their skb->truesize being slightly over estimated is not an issue.