netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] bnx2x: fix skb truesize underestimation
@ 2011-10-20  9:00 Eric Dumazet
  2011-10-20  9:23 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2011-10-20  9:00 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Eilon Greenstein

bnx2x allocates a full page per fragment.

We must account in skb->truesize, the size of the fragment, not the used
part of it.
    
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index dd8ee56..580b44e 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -454,7 +454,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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] bnx2x: fix skb truesize underestimation
  2011-10-20  9:00 [PATCH net-next] bnx2x: fix skb truesize underestimation Eric Dumazet
@ 2011-10-20  9:23 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-10-20  9:23 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev, eilong

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 20 Oct 2011 11:00:23 +0200

> bnx2x allocates a full page per fragment.
> 
> We must account in skb->truesize, the size of the fragment, not the used
> part of it.
>     
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> CC: Eilon Greenstein <eilong@broadcom.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-20  9:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-20  9:00 [PATCH net-next] bnx2x: fix skb truesize underestimation Eric Dumazet
2011-10-20  9:23 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).