From patchwork Thu Oct 13 17:50:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 119578 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id DE92BB6FA6 for ; Fri, 14 Oct 2011 04:50:11 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756601Ab1JMRuE (ORCPT ); Thu, 13 Oct 2011 13:50:04 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:59131 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752964Ab1JMRuC (ORCPT ); Thu, 13 Oct 2011 13:50:02 -0400 Received: by wwf22 with SMTP id 22so2173340wwf.1 for ; Thu, 13 Oct 2011 10:50:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:subject:from:to:cc:date:content-type:x-mailer :content-transfer-encoding:mime-version; bh=0qaxoLvPajunkCu46PPE2nDD1q8VTbrqbSGk0SSPQfo=; b=GPHeBiQA8LlBzbN7vKameyUSQqZLnLSjrjL4Z0xYPwNT2/5joJAUbiXJSaV5VlSIh3 xfqhtNsAVkIgAv+QQ38FwSadCub5rAA1MbniEMIeDwxSbfR+01IP7Fp4tg7Pyy+xWXV9 tlxEYQsOAMe1PCcOAxlw/7rNRo6dz2NBOJafI= Received: by 10.227.169.140 with SMTP id z12mr1718243wby.20.1318528201376; Thu, 13 Oct 2011 10:50:01 -0700 (PDT) Received: from [10.150.51.214] (gw0.net.jmsp.net. [212.23.165.14]) by mx.google.com with ESMTPS id ei16sm7644301wbb.21.2011.10.13.10.49.59 (version=SSLv3 cipher=OTHER); Thu, 13 Oct 2011 10:50:00 -0700 (PDT) Message-ID: <1318528219.2393.52.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> Subject: [PATCH net-next] bnx2: fix skb truesize underestimation From: Eric Dumazet To: David Miller Cc: netdev , Michael Chan Date: Thu, 13 Oct 2011 19:50:19 +0200 X-Mailer: Evolution 3.2.0- Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- drivers/net/ethernet/broadcom/bnx2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c index 3c221be..6ff7636 100644 --- a/drivers/net/ethernet/broadcom/bnx2.c +++ b/drivers/net/ethernet/broadcom/bnx2.c @@ -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);