All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael Chan" <mchan@broadcom.com>
To: "Josip Rodin" <joy@entuzijast.net>
Cc: "'Bill Fink'" <billfink@mindspring.com>,
	"Ben Hutchings" <bhutchings@solarflare.com>,
	netdev <netdev@vger.kernel.org>,
	"mirrors@debian.org" <mirrors@debian.org>
Subject: Re: bnx2_poll panicking kernel
Date: Tue, 24 Jun 2008 15:58:33 -0700	[thread overview]
Message-ID: <48617C19.3010005@broadcom.com> (raw)
In-Reply-To: <48602847.1020203@broadcom.com>

Michael Chan wrote:
> I will send Josip another patch to print more SKB fields.  I can
> even save all the SKB fields and see which other ones are modified besides
> the nr_frags.  May be that will give us a better clue.
> 
Please try this patch, which should go on top of the last debug patch.
Thanks.


diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index f7ecd07..52756b6 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -2476,6 +2476,22 @@ bnx2_get_hw_tx_cons(struct bnx2_napi *bnapi)
 	return cons;
 }
 
+static void
+bnx2_dump_mem(void *ptr, int size)
+{
+	u32 *p = ptr;
+	int i;
+
+	for (i = 0; i < size; i += 4) {
+		if ((i % 32) == 0)
+			printk(KERN_ALERT);
+		printk("%08x ", *p++);
+		if ((i % 32) == 28 || i == (size - 4))
+			printk("\n");
+	}
+	printk(KERN_ALERT "\n");
+}
+
 static int
 bnx2_tx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget)
 {
@@ -2500,6 +2516,15 @@ bnx2_tx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget)
 					  " should be %d\n",
 					  skb_shinfo(skb)->nr_frags,
 					  tx_buf->nr_frags);
+			printk(KERN_ALERT "original skb:\n");
+			bnx2_dump_mem(&bp->tx_skb_ring[sw_ring_cons],
+					sizeof(struct sk_buff));
+			bnx2_dump_mem(&bp->tx_skb_sh_ring[sw_ring_cons],
+					sizeof(struct skb_shared_info));
+			printk(KERN_ALERT "Corrupted skb:\n");
+			bnx2_dump_mem(skb, sizeof(*skb));
+			bnx2_dump_mem(skb_shinfo(skb),
+				sizeof(struct skb_shared_info));
 		}
 		/* partial BD completions possible with TSO packets */
 		if (skb_is_gso(skb)) {
@@ -5866,6 +5891,8 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	last_frag = skb_shinfo(skb)->nr_frags;
 
 	tx_buf->nr_frags = last_frag;
+	bp->tx_skb_ring[ring_prod] = *skb;
+	bp->tx_skb_sh_ring[ring_prod] = *skb_shinfo(skb);
 
 	for (i = 0; i < last_frag; i++) {
 		skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h
index aa9fa6f..91569dd 100644
--- a/drivers/net/bnx2.h
+++ b/drivers/net/bnx2.h
@@ -6649,6 +6649,9 @@ struct bnx2 {
 	int		tx_ring_size;
 	u32		tx_wake_thresh;
 
+	struct sk_buff		tx_skb_ring[TX_DESC_CNT];
+	struct skb_shared_info	tx_skb_sh_ring[TX_DESC_CNT];
+
 	/* End of fields used in the performance code paths. */
 
 	char			*name;


  reply	other threads:[~2008-06-24 22:56 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-16 12:57 bnx2_poll panicking kernel Josip Rodin
2008-06-16 14:04 ` Ben Hutchings
2008-06-16 15:52   ` Michael Chan
2008-06-16 19:13     ` Josip Rodin
2008-06-16 21:38       ` Josip Rodin
2008-06-16 21:48         ` Josip Rodin
2008-06-16 23:45           ` Michael Chan
2008-06-17 22:37             ` Josip Rodin
2008-06-17 22:47               ` Michael Chan
2008-06-21 11:18                 ` Josip Rodin
2008-06-21 15:34                   ` Bill Fink
2008-06-21 16:11                     ` Michael Chan
2008-06-23 18:04                       ` Josip Rodin
2008-06-23 21:36                         ` Josip Rodin
2008-06-23 22:48                           ` Michael Chan
2008-06-24 22:58                             ` Michael Chan [this message]
2008-06-25  0:04                               ` David Miller
2008-06-26 11:01                               ` Josip Rodin
2008-06-26 18:04                                 ` Michael Chan
2008-07-09 16:46                                   ` Josip Rodin
2008-07-09 16:57                                     ` Michael Chan
2008-07-09 23:46                                       ` David Miller
2008-07-10  9:45                                         ` Aviv Greenberg
2008-07-10 10:09                                           ` David Miller
2008-07-10 21:00                                         ` Michael Chan
2008-07-10 21:00                                           ` David Miller
2008-07-10 21:23                                           ` Josip Rodin
2008-07-10 21:38                                             ` Michael Chan
2008-07-10 22:00                                               ` Josip Rodin
2008-07-10 22:26                                                 ` Michael Chan
2008-07-10 22:31                                                   ` Josip Rodin
2008-07-10 23:20                                                     ` David Miller
2008-07-11  9:24                                                       ` Josip Rodin
2008-07-11  9:56                                                         ` David Miller
2008-07-11 12:19                                                           ` Patrick McHardy
2008-07-12  9:49                                                           ` Jarek Poplawski
2008-07-12 13:21                                                             ` Jarek Poplawski
2008-07-14 15:27                                                               ` Patrick McHardy
2008-07-14 17:20                                                                 ` Jarek Poplawski
2008-07-14 17:25                                                                   ` Jarek Poplawski
2008-07-14 20:21                                                                   ` Josip Rodin
2008-07-14 21:22                                                                     ` Jarek Poplawski
2008-07-14 21:26                                                                       ` Josip Rodin
2008-07-14 21:48                                                                         ` Jarek Poplawski
2008-07-17 21:30                                                                           ` Josip Rodin
2008-07-17 21:44                                                                             ` David Miller
2008-07-18  5:12                                                                               ` Jarek Poplawski
2008-08-02 12:28                                                                               ` bad htb_{en,re}queue return codes causing corrupt data in drivers [was Re: bnx2_poll panicking kernel] Josip Rodin
2008-08-03  7:06                                                                                 ` bad htb_{en,re}queue return codes causing corrupt data in drivers David Miller
2008-07-14 22:05                                                                         ` bnx2_poll panicking kernel Jarek Poplawski

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=48617C19.3010005@broadcom.com \
    --to=mchan@broadcom.com \
    --cc=bhutchings@solarflare.com \
    --cc=billfink@mindspring.com \
    --cc=joy@entuzijast.net \
    --cc=mirrors@debian.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.