bnx2: fix skb truesize underestimation
authorEric Dumazet <eric.dumazet@gmail.com>
Thu, 13 Oct 2011 07:50:19 +0000 (07:50 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 13 Oct 2011 20:05:07 +0000 (16:05 -0400)
bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnx2.c

index 3c221be9d1e28526fc3d7f8ca4f7474f252df535..6ff7636e73a2807cbc3c8edc4276e6165954c384 100644 (file)
@@ -3051,7 +3051,6 @@ bnx2_rx_skb(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, struct sk_buff *skb,
                                                &skb_shinfo(skb)->frags[i - 1];
                                        frag->size -= tail;
                                        skb->data_len -= tail;
-                                       skb->truesize -= tail;
                                }
                                return 0;
                        }
@@ -3083,7 +3082,7 @@ bnx2_rx_skb(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, struct sk_buff *skb,
 
                        frag_size -= frag_len;
                        skb->data_len += frag_len;
-                       skb->truesize += frag_len;
+                       skb->truesize += PAGE_SIZE;
                        skb->len += frag_len;
 
                        pg_prod = NEXT_RX_BD(pg_prod);