mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Francois Romieu <romieu@fr.zoreil.com>
To: booster@wolke7.net
Cc: Jonathan Nieder <jrnieder@gmail.com>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	netdev@vger.kernel.org, nic_swsd@realtek.com,
	linux-kernel@vger.kernel.org,
	Armin Kazmi <armin.kazmi@tu-dortmund.de>,
	Hayes Wang <hayeswang@realtek.com>
Subject: Re: [bug?] r8169: hangs under heavy load
Date: Mon, 28 Nov 2011 00:11:47 +0100	[thread overview]
Message-ID: <20111127231147.GA1784@electric-eye.fr.zoreil.com> (raw)
In-Reply-To: <4ED2A573.1020807@wolke7.net>

booster@wolke7.net <booster@wolke7.net> :
[...]
> Jonathan, I compiled a new kernel with the patch described above but the
> behavior is still the same. During high network load the link hangs:
> 
> [  195.332478] r8169 0000:02:00.0: eth0: link up
> [  222.517171] r8169 0000:02:00.0: eth0: link up
> [  222.908277] r8169 0000:02:00.0: eth0: link up
> [  223.508249] r8169 0000:02:00.0: eth0: link up

It does recover, doesn't it ?

> Is there a way to activate more driver debugging in the kernel ?

You can lower the delay in rtl8169_schedule_work (4) but it is akin
to papering over the issue.

You may try the stuff below in place of the current patch. I will not
be surprized if the link really hangs (no crash but no traffic).

Hayes, does the 8168c require something special to recover from Rx FIFO
overflow ?

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 6f06aa1..e937737 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -427,6 +427,7 @@ enum rtl_register_content {
 	/* InterruptStatusBits */
 	SYSErr		= 0x8000,
 	PCSTimeout	= 0x4000,
+	RxFIFOEmpty	= 0x0200,
 	SWInt		= 0x0100,
 	TxDescUnavail	= 0x0080,
 	RxFIFOOver	= 0x0040,
@@ -5815,15 +5816,27 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
 		}
 
 		if (unlikely(status & RxFIFOOver)) {
+			int i;
+
 			switch (tp->mac_version) {
 			/* Work around for rx fifo overflow */
 			case RTL_GIGA_MAC_VER_11:
-			case RTL_GIGA_MAC_VER_22:
 			case RTL_GIGA_MAC_VER_26:
 				netif_stop_queue(dev);
 				rtl8169_tx_timeout(dev);
 				goto done;
 			/* Testers needed. */
+			case RTL_GIGA_MAC_VER_22:
+				for (i = 0; i < 4000000; i++) {
+					if (RTL_R16(IntrStatus) & RxFIFOEmpty) {
+						RTL_W16(IntrStatus, RxFIFOOver);
+						printk(KERN_INFO "FEmp %d\n", i);
+						break;
+					}
+					udelay(10);
+				}
+				if (i >= 4000000)
+					printk(KERN_ERR "no FEmp\n");
 			case RTL_GIGA_MAC_VER_17:
 			case RTL_GIGA_MAC_VER_19:
 			case RTL_GIGA_MAC_VER_20:

  reply	other threads:[~2011-11-27 23:18 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4E7F4D45.7040902@wolke7.net>
     [not found] ` <1316978632.4122.103.camel@deadeye>
     [not found]   ` <4E82C0B5.1050902@wolke7.net>
     [not found]     ` <1317254171.4068.12.camel@deadeye>
     [not found]       ` <20111124044137.GA18262@elie.hsd1.il.comcast.net>
     [not found]         ` <4ECFE7A7.5070300@wolke7.net>
2011-11-25 20:19           ` Jonathan Nieder
2011-11-25 20:31             ` Jonathan Nieder
2011-11-25 20:32             ` Eric Dumazet
2011-11-25 20:54               ` Jonathan Nieder
2011-11-25 21:05                 ` Eric Dumazet
2011-11-25 22:22               ` Francois Romieu
2011-11-25 23:05                 ` Eric Dumazet
2011-11-26  0:44                   ` Francois Romieu
2011-11-26  4:07                     ` Eric Dumazet
2011-11-27  9:28                       ` Jonathan Nieder
2011-11-27 21:02                         ` booster
2011-11-27 23:11                           ` Francois Romieu [this message]
2011-11-29  6:47                             ` hayeswang
2011-11-29 10:54                               ` Francois Romieu
2011-11-29 19:56                                 ` booster
2011-12-01 10:20                                   ` Francois Romieu
2011-12-01 20:42                                     ` booster
2011-12-01 22:26                                       ` Francois Romieu
2011-12-05  6:30                                         ` [PATCH 1/2] r8169: Rx FIFO overflow fixes Francois Romieu
2011-12-05 23:45                                           ` David Miller
2012-02-20  2:37                                           ` Jonathan Nieder
2012-02-20 23:22                                             ` Francois Romieu
2011-12-05  6:30                                         ` [PATCH 2/2] r8169: fix Rx index race between FIFO overflow recovery and NAPI handler Francois Romieu
2011-12-05 23:45                                           ` David Miller
2011-12-02  2:21                                 ` [bug?] r8169: hangs under heavy load hayeswang

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=20111127231147.GA1784@electric-eye.fr.zoreil.com \
    --to=romieu@fr.zoreil.com \
    --cc=armin.kazmi@tu-dortmund.de \
    --cc=booster@wolke7.net \
    --cc=eric.dumazet@gmail.com \
    --cc=hayeswang@realtek.com \
    --cc=jrnieder@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    /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®