Skip to content

Commit

Permalink
vmxnet3: fix skb truesize underestimation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Oct 14, 2011
1 parent 5935f81 commit 5e6c355
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/vmxnet3/vmxnet3_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 5e6c355

Please sign in to comment.