mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Francois Romieu <romieu@fr.zoreil.com>
To: Seblu <seblu@seblu.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	lkml <linux-kernel@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>, Ivan Vecera <ivecera@redhat.com>
Subject: Re: Mass udp flow reboot linux with RealTek RTL-8169 Gigabit
Date: Fri, 18 Feb 2011 10:30:00 +0100	[thread overview]
Message-ID: <20110218093000.GA12106@electric-eye.fr.zoreil.com> (raw)
In-Reply-To: <AANLkTi=PrOXMD54hSbEwUtmzXiwsSwiSijE3AJ9n=WDe@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 813 bytes --]

Seblu <seblu@seblu.net> :
[...]
> I've applyed your patch on 2.6.38-rc5. Host have rebooted 2mn after udp start.
> After this reboot, host is still on after 2 hour under a 1Gbit/s udp flow.

Thanks for testing.

> I attached a dmesg output before reboot. Do you need anything else?

Mostly :
1. .config
2. the size of the udp packets and the mtu

As an option :
3. a few seconds of 'vmstat 1' from the host under test
4. an 'ethtool -s eth0' from the host under test
5. /proc/interrupts from the host under test
6. lspci -tv 

Can you apply the two attached patches on top of the previous ones and
give it a try ? The debug should not be too verbose if things are stationary
enough.

Do you have a serial cable and a second computer at hand by chance (don't
go for netconsole with the r8169 driver) ?

-- 
Ueimor

[-- Attachment #2: 0001-r8169-TX-stop-queue-race-fix.patch --]
[-- Type: text/plain, Size: 1129 bytes --]

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 59ccf0c..712231f 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -4361,13 +4361,13 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
 
 	tp->cur_tx += frags + 1;
 
-	wmb();
-
 	RTL_W8(TxPoll, NPQ);	/* set polling bit */
 
+	mmiowb();
+
 	if (TX_BUFFS_AVAIL(tp) < MAX_SKB_FRAGS) {
 		netif_stop_queue(dev);
-		smp_rmb();
+		smp_mb();
 		if (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)
 			netif_wake_queue(dev);
 	}
@@ -4468,10 +4468,14 @@ static void rtl8169_tx_interrupt(struct net_device *dev,
 
 	if (tp->dirty_tx != dirty_tx) {
 		tp->dirty_tx = dirty_tx;
-		smp_wmb();
-		if (netif_queue_stopped(dev) &&
-		    (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)) {
-			netif_wake_queue(dev);
+		smp_mb();
+		if (unlikely(netif_queue_stopped(dev) &&
+		    (TX_BUFFS_AVAIL(tp) >= (NUM_TX_DESC / 4)))) {
+			netif_tx_lock(dev);
+			if (netif_queue_stopped(dev) &&
+			    (TX_BUFFS_AVAIL(tp) >= (NUM_TX_DESC / 4)))
+				netif_wake_queue(dev);
+			netif_tx_unlock(dev);
 		}
 		/*
 		 * 8168 hack: TxPoll requests are lost when the Tx packets are
-- 
1.7.3.4


[-- Attachment #3: 0002-r8169-debuginator.patch --]
[-- Type: text/plain, Size: 856 bytes --]

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 712231f..5eaccbb 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -4622,6 +4622,11 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
 	return count;
 }
 
+static struct {
+	u16 status[4];
+	u16 idx;
+} x = { { 0 }, 0 };
+
 static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
 {
 	struct net_device *dev = dev_instance;
@@ -4637,6 +4642,12 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
 	while (status && status != 0xffff) {
 		handled = 1;
 
+		x.status[x.idx++ % 4] = status;
+		if (net_ratelimit()) {
+			printk(KERN_INFO "%04x %04x %04x %04x\n",
+				x.status[0], x.status[1],
+				x.status[2], x.status[3]);
+		}
 		/* Handle all of the error cases first. These will reset
 		 * the chip, so just exit the loop.
 		 */
-- 
1.7.3.4


  reply	other threads:[~2011-02-18  9:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-13  1:35 Seblu
2011-02-13  7:17 ` Eric Dumazet
2011-02-13 13:56   ` Francois Romieu
2011-02-13 17:27     ` Seblu
2011-02-13 18:02       ` Seblu
2011-02-13 20:34         ` Francois Romieu
2011-02-18  2:54           ` Seblu
2011-02-18  9:30             ` Francois Romieu [this message]
2011-03-06  0:29               ` Seblu
2011-03-10 12:08                 ` Francois Romieu
2011-02-21 11:56 Hans Nieser
2011-02-22 17:33 Hans Nieser
2011-02-23  9:55 ` Francois Romieu
2011-02-23 12:21   ` Hans Nieser
2011-02-23 18:31     ` Hans Nieser
2011-02-25 13:45       ` Hans Nieser
2011-03-03 19:53         ` Hans Nieser

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=20110218093000.GA12106@electric-eye.fr.zoreil.com \
    --to=romieu@fr.zoreil.com \
    --cc=eric.dumazet@gmail.com \
    --cc=ivecera@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=seblu@seblu.net \
    /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

all inboxes | Powered by JetHome®