From: "Jeff Kirsher" <jeffrey.t.kirsher@intel.com>
To: "Herbert Xu" <herbert@gondor.apana.org.au>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
"Emil Tantilov" <emil.s.tantilov@intel.com>
Subject: Re: [2/2] igb: Replace LRO with GRO
Date: Wed, 14 Jan 2009 17:35:00 -0800 [thread overview]
Message-ID: <9929d2390901141735j11fa609aya9196defdc9818d5@mail.gmail.com> (raw)
In-Reply-To: <20090115003246.GA26461@gondor.apana.org.au>
On Wed, Jan 14, 2009 at 4:32 PM, Herbert Xu <herbert@gondor.apana.org.au> wrote:
> On Wed, Jan 14, 2009 at 04:03:10PM -0800, Jeff Kirsher wrote:
>>
>> We are seeing a kernel panic during our testing using jumbo frames,
>> below is the trace.
>
> Thanks! This was the one case that I didn't test with e1000e,
> namely an skb with page frags which comes from the driver (as
> opposed to being constructed by the stack through gro_receive_frags).
>
> gro: Fix page ref count for skbs freed normally
>
> When an skb with page frags is merged into an existing one, we
> cannibalise its reference count. This is OK when the skb is
> reused because we set nr_frags to zero in that case. However,
> for the case where the skb is freed through kfree_skb, we didn't
> clear nr_frags which causes the page to be freed prematurely.
>
> This is fixed by moving the skb resetting into skb_gro_receive.
>
> Reported-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 972a47d..4f69a2d 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -2481,12 +2481,6 @@ EXPORT_SYMBOL(napi_gro_receive);
>
> void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb)
> {
> - skb_shinfo(skb)->nr_frags = 0;
> -
> - skb->len -= skb->data_len;
> - skb->truesize -= skb->data_len;
> - skb->data_len = 0;
> -
> __skb_pull(skb, skb_headlen(skb));
> skb_reserve(skb, NET_IP_ALIGN - skb_headroom(skb));
>
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 5110b35..65eac77 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -2602,6 +2602,12 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb)
> skb_shinfo(skb)->nr_frags * sizeof(skb_frag_t));
>
> skb_shinfo(p)->nr_frags += skb_shinfo(skb)->nr_frags;
> + skb_shinfo(skb)->nr_frags = 0;
> +
> + skb->truesize -= skb->data_len;
> + skb->len -= skb->data_len;
> + skb->data_len = 0;
> +
> NAPI_GRO_CB(skb)->free = 1;
> goto done;
> }
>
> Cheers,
> --
> Visit Openswan at http://www.openswan.org/
> Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
> --
>
Might want to redo the subject line so that Dave knows that this is a
different patch, since you already have the IGB conversion to GRO
patch in this mail thread.
--
Cheers,
Jeff
next prev parent reply other threads:[~2009-01-15 1:35 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-13 9:26 [1/2] e1000e: Invoke VLAN GRO handler Herbert Xu
2009-01-13 9:28 ` [2/2] igb: Replace LRO with GRO Herbert Xu
2009-01-14 8:44 ` ixgbe: " Herbert Xu
2009-01-14 11:53 ` Jeff Kirsher
2009-01-15 3:46 ` Herbert Xu
2009-01-15 4:22 ` Herbert Xu
2009-01-19 5:49 ` David Miller
2009-01-16 23:32 ` Jeff Kirsher
2009-01-17 0:36 ` Herbert Xu
2009-01-17 1:06 ` Tantilov, Emil S
2009-01-17 3:45 ` Herbert Xu
2009-01-17 8:07 ` Tantilov, Emil S
2009-01-17 9:52 ` Herbert Xu
2009-01-17 13:04 ` Herbert Xu
2009-01-20 23:00 ` Tantilov, Emil S
2009-01-17 15:44 ` Tantilov, Emil S
2009-01-14 11:49 ` [2/2] igb: " Jeff Kirsher
2009-01-14 12:36 ` Herbert Xu
2009-01-15 0:03 ` Jeff Kirsher
2009-01-15 0:32 ` Herbert Xu
2009-01-15 1:35 ` Jeff Kirsher [this message]
2009-01-15 1:56 ` David Miller
2009-01-15 2:02 ` Jeff Kirsher
2009-01-15 4:40 ` David Miller
2009-01-19 5:47 ` David Miller
2009-01-19 11:16 ` Herbert Xu
2009-01-19 22:34 ` Jeff Kirsher
2009-01-19 23:21 ` David Miller
2009-01-15 4:24 ` sfc: " Herbert Xu
2009-01-19 5:50 ` David Miller
2009-01-19 14:40 ` Ben Hutchings
2009-01-19 21:29 ` David Miller
2009-01-19 22:12 ` Harvey Harrison
2009-01-19 23:27 ` David Miller
2009-01-20 0:57 ` Stephen Rothwell
2009-01-15 4:38 ` [1/2] e1000e: Invoke VLAN GRO handler David Miller
2009-01-15 6:59 ` cxgb3: Replace LRO with GRO Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9929d2390901141735j11fa609aya9196defdc9818d5@mail.gmail.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=davem@davemloft.net \
--cc=emil.s.tantilov@intel.com \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).