]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bnx2: fix skb truesize underestimation
authorEric Dumazet <eric.dumazet@gmail.com>
Thu, 13 Oct 2011 07:50:19 +0000 (07:50 +0000)
committerJoe Jin <joe.jin@oracle.com>
Wed, 16 May 2012 05:55:56 +0000 (13:55 +0800)
bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

(cherry picked from commit a1f4e8bcbccf50cf1894c263af4d677d4f566533)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/bnx2.c

index b147ef68646694dbd386d33e4fad762bb9603a39..c026af70d88ab6702cb93c2ca710d400d39fd1c0 100644 (file)
@@ -3041,7 +3041,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;
                        }
@@ -3073,7 +3072,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);