netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jesper@krogh.cc
Cc: jdb@comx.dk, netdev@vger.kernel.org
Subject: Re: NIU driver: Sun x8 Express Quad Gigabit Ethernet Adapter
Date: Tue, 11 Nov 2008 16:18:49 -0800 (PST)	[thread overview]
Message-ID: <20081111.161849.251632080.davem@davemloft.net> (raw)
In-Reply-To: <20081111.155041.90523159.davem@davemloft.net>

From: David Miller <davem@davemloft.net>
Date: Tue, 11 Nov 2008 15:50:41 -0800 (PST)

> If you could run those test patches when I post them and give
> the log messages they produce, I'd appreciate it.

Ok, let's start with this debugging patch below.

When the chip gets a TX timeout it's going to dump a lot of
state.  First it will dump the state of the logic device group
interrupt vectors (both hardware and software copies).

Then, for each TX ring, it will dump the TX_CS register (both
software and hardware copies), the mapping from that TX ring
to logical-device number and logical device group.  It will
also print out how many packets are in the ring but not freed
up yet.

Please post the dump that results when the condition triggers.
Just provide the first dump the kernel spits out.

Thanks.

diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index 2c3bb36..beffbc5 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -6070,12 +6070,79 @@ static void niu_reset_task(struct work_struct *work)
 	spin_unlock_irqrestore(&np->lock, flags);
 }
 
+static void niu_dump_ldg_vecs(struct net_device *dev)
+{
+	struct niu *np = netdev_priv(dev);
+	int i;
+
+	for (i = 0; i < np->num_ldg; i++) {
+		struct niu_ldg *lp = &np->ldg[i];
+		u64 v0, v1, v2;
+
+		v0 = nr64(LDSV0(lp->ldg_num));
+		v1 = nr64(LDSV1(lp->ldg_num));
+		v2 = nr64(LDSV2(lp->ldg_num));
+
+		dev_err(np->device, PFX "%s: LDG[idx(%d):num(%u)] "
+			"V0[sw(0x%llx)hw(0x%llx)] "
+			"V1[sw(0x%llx)hw(0x%llx)] "
+			"V2[sw(0x%llx)hw(0x%llx)]\n",
+			dev->name, i, lp->ldg_num,
+			(unsigned long long) lp->v0,
+			(unsigned long long) v0,
+			(unsigned long long) lp->v1,
+			(unsigned long long) v1,
+			(unsigned long long) lp->v2,
+			(unsigned long long) v2);
+	}
+}
+
+static void niu_dump_one_tx_ring(struct net_device *dev,
+				 struct niu *np, int index)
+{
+	struct tx_ring_info *rp = &np->tx_rings[index];
+	struct niu_parent *parent = np->parent;
+	int ldn = LDN_TXDMA(rp->tx_channel);
+	int i, num_pending_skbs = 0;
+
+	dev_err(np->device, PFX "%s: TX_RING[%2u] CHANNEL %u LDN %u\n",
+		dev->name, index, rp->tx_channel, ldn);
+
+	dev_err(np->device, PFX "%s: TX_RING[%2u] parent->lgd_map[ldn] %u\n",
+		dev->name, index, parent->ldg_map[ldn]);
+
+	for (i = 0; i < MAX_TX_RING_SIZE; i++) {
+		if (rp->tx_buffs[i].skb)
+			num_pending_skbs++;
+	}
+	dev_err(np->device, PFX "%s: TX_RING[%2u] Num pending TX SKBs: %d\n",
+		dev->name, index, num_pending_skbs);
+	dev_err(np->device, PFX "%s: TX_RING[%2u] TX_CS sw[%016llx] "
+		"hw[%016llx]\n",
+		dev->name, index,
+		(unsigned long long) rp->tx_cs,
+		(unsigned long long) nr64(TX_CS(rp->tx_channel)));
+}
+
+static void niu_dump_tx_state(struct net_device *dev)
+{
+	struct niu *np = netdev_priv(dev);
+	int i;
+
+	dev_err(np->device, PFX "%s: Dumping transmitter state.\n",
+		dev->name);
+	for (i = 0; i < np->num_tx_rings; i++)
+		niu_dump_one_tx_ring(dev, np, i);
+}
+
 static void niu_tx_timeout(struct net_device *dev)
 {
 	struct niu *np = netdev_priv(dev);
 
 	dev_err(np->device, PFX "%s: Transmit timed out, resetting\n",
 		dev->name);
+	niu_dump_ldg_vecs(dev);
+	niu_dump_tx_state(dev);
 
 	schedule_work(&np->reset_task);
 }

  reply	other threads:[~2008-11-12  0:18 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-04 14:45 NIU driver: Sun x8 Express Quad Gigabit Ethernet Adapter Jesper Dangaard Brouer
2008-11-04 21:42 ` David Miller
2008-11-05  7:05   ` Jesper Dangaard Brouer
2008-11-05  7:33     ` David Miller
2008-11-05  9:30       ` Jesper Dangaard Brouer
2008-11-05  9:34         ` David Miller
2008-11-11 19:19 ` Jesper Krogh
2008-11-11 23:50   ` David Miller
2008-11-12  0:18     ` David Miller [this message]
2008-11-12  9:36       ` Jesper Dangaard Brouer
2008-11-12  9:49         ` David Miller
2008-11-12 10:04           ` Jesper Dangaard Brouer
2008-11-12 11:01           ` Jesper Dangaard Brouer
2008-11-12 11:52             ` David Miller
2008-11-12 12:11               ` David Miller
2008-11-12 12:49                 ` Jesper Dangaard Brouer
2008-11-13  8:50                   ` Jesper Dangaard Brouer
2008-11-13 22:08                     ` David Miller
2008-11-14 12:38                       ` NIU driver: Sun x8 Express Quad Gigabit Ethernet Adapter (rmmod BUG) Jesper Dangaard Brouer
2008-11-14 18:49                         ` Jesper Dangaard Brouer
2008-11-15  0:21                           ` David Miller
2008-11-19 12:10                             ` Jesper Dangaard Brouer
2008-11-12 12:54                 ` NIU driver: Sun x8 Express Quad Gigabit Ethernet Adapter Ben Hutchings
2008-11-12 13:21                   ` Jesper Dangaard Brouer
2008-11-12 21:46                   ` David Miller
2008-11-12 21:50                     ` Ben Hutchings
2008-11-12 22:26                       ` David Miller
2008-11-12 22:58                         ` Roland Dreier
2008-11-12 17:56                 ` Jesper Krogh
2008-11-12 21:43                   ` David Miller
2008-11-12 21:31                 ` Jesper Dangaard Brouer
2008-11-12 23:10                   ` Matheos Worku
2008-11-13  9:10                 ` Jesper Dangaard Brouer
2008-11-13 22:19                   ` David Miller
2008-11-13 10:29                 ` Jesper Dangaard Brouer
2008-11-13 22:15                   ` David Miller
2008-11-19 22:58                     ` NIU driver: Sun x8 Express Quad Gigabit Ethernet Adapter (perf + regression IRQs) Jesper Dangaard Brouer
2008-11-19 23:11                       ` David Miller
2008-11-20 19:48                         ` Regression: Bisected, IRQ and MSI allocations screwed without sparse irq Jesper Dangaard Brouer
2008-11-21  0:34                           ` Thomas Gleixner
2008-11-21 10:33                             ` Jesper Dangaard Brouer
2008-11-21 16:40                               ` Thomas Gleixner
2008-11-21 19:35                                 ` Jesper Dangaard Brouer
2008-11-21 21:11                                   ` Thomas Gleixner
2008-11-21 23:06                                   ` David Miller

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=20081111.161849.251632080.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jdb@comx.dk \
    --cc=jesper@krogh.cc \
    --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).