Re: [PATCH net-next] tcp: avoid expensive pskb_expand_head() calls

Vijay Subramanian
2012-04-18T19:41:43Z

>  {
>        if (skb_cloned(skb) && pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
>                return -ENOMEM;
> @@ -1134,6 +1138,7 @@ int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len)
>        __pskb_trim_head(skb, len);
>
>        TCP_SKB_CB(skb)->seq += len;
> +       TCP_SKB_CB(skb)->header.offset_ack = 0;
>        skb->ip_summed = CHECKSUM_PARTIAL;
>
>        skb->truesize        -= len;
>

Eric,
tcp_trim_head() also updates skb->truesize as above. But is this the
right thing to do when only offsets/pointers are updated. If
__pskb_trim_head() removes len bytes but does not actually free
memory,
should truesize be updated? This could happen if data in the linear
part is acked. This behavior takes place currently even without your
patch, by the way.

Thanks,
Vijay