Subject: Re: bnx2_poll panicking kernel

From: "Michael Chan" <[email-masked]>
Date: Thu, 10 Jul 2008 14:00:17 -0700

On Wed, 2008-07-09 at 16:46 -0700, David Miller wrote:
> Actually I went investigating this and all the code paths check for
> skb_cloned() and if true they make a copy of the data area (and thus
> the skb_shared_info()) and this should ensure that the driver doesn't
> see changing nr_frags values.

Since Josip can readily reproduce this problem, let's confirm if the SKB
is split while it is cloned.  Please try this debug patch:

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 5c459f2..03ec3b8 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1960,6 +1960,10 @@ void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len)
 {
 	int pos = skb_headlen(skb);
 
+	if (skb_cloned(skb)) {
+		printk(KERN_ALERT "Splitting cloned skb\n")
+		dump_stack();
+	}
 	if (len < pos)	/* Split line is inside header. */
 		skb_split_inside_header(skb, skb1, len, pos);
 	else		/* Second chunk has no header, nothing to copy. */