]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bnx2x: fix skb truesize underestimation
authorEric Dumazet <eric.dumazet@gmail.com>
Wed, 19 Oct 2011 23:00:23 +0000 (23:00 +0000)
committerJoe Jin <joe.jin@oracle.com>
Wed, 16 May 2012 10:12:23 +0000 (18:12 +0800)
bnx2x allocates a full page per fragment.

We must account in skb->truesize, the size of the fragment, not the used
part of it.

(cherry picked from commit e1ac50f64691de9a095ac5d73cb8ac73d3d17dba)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/bnx2x/bnx2x_cmn.c

index 3871388919da0c01191e8db2f9e7a176b9028a38..c072c6713c2273e1c333938f032e02815878ec30 100644 (file)
@@ -452,7 +452,7 @@ static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp,
                skb_fill_page_desc(skb, j, old_rx_pg.page, 0, frag_len);
 
                skb->data_len += frag_len;
-               skb->truesize += frag_len;
+               skb->truesize += SGE_PAGE_SIZE * PAGES_PER_SGE;
                skb->len += frag_len;
 
                frag_size -= frag_len;