Commit a1f4e8bc authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bdb28a97
...@@ -3051,7 +3051,6 @@ bnx2_rx_skb(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, struct sk_buff *skb, ...@@ -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]; &skb_shinfo(skb)->frags[i - 1];
frag->size -= tail; frag->size -= tail;
skb->data_len -= tail; skb->data_len -= tail;
skb->truesize -= tail;
} }
return 0; return 0;
} }
...@@ -3083,7 +3082,7 @@ bnx2_rx_skb(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, struct sk_buff *skb, ...@@ -3083,7 +3082,7 @@ bnx2_rx_skb(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, struct sk_buff *skb,
frag_size -= frag_len; frag_size -= frag_len;
skb->data_len += frag_len; skb->data_len += frag_len;
skb->truesize += frag_len; skb->truesize += PAGE_SIZE;
skb->len += frag_len; skb->len += frag_len;
pg_prod = NEXT_RX_BD(pg_prod); pg_prod = NEXT_RX_BD(pg_prod);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment