vmxnet3: fix skb truesize underestimation
authorEric Dumazet <eric.dumazet@gmail.com>
Thu, 13 Oct 2011 11:38:17 +0000 (11:38 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 Oct 2011 02:25:21 +0000 (22:25 -0400)
vmxnet3 allocates a page per skb fragment. We must account
PAGE_SIZE increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Shreyas Bhatewara <sbhatewara@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vmxnet3/vmxnet3_drv.c

index 1694038192e0d6d4b177acba1056cc3c9adabc87..902f284fd0548ba811964a65b32e72925e0c607e 100644 (file)
@@ -658,6 +658,7 @@ vmxnet3_append_frag(struct sk_buff *skb, struct Vmxnet3_RxCompDesc *rcd,
        frag->page_offset = 0;
        frag->size = rcd->len;
        skb->data_len += frag->size;
+       skb->truesize += PAGE_SIZE;
        skb_shinfo(skb)->nr_frags++;
 }
 
@@ -1277,7 +1278,6 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
                skb = ctx->skb;
                if (rcd->eop) {
                        skb->len += skb->data_len;
-                       skb->truesize += skb->data_len;
 
                        vmxnet3_rx_csum(adapter, skb,
                                        (union Vmxnet3_GenericDesc *)rcd);