Skip to contentSkip to conversation

rtl8169 problem and 2.4.23

DISCUSSION Daniel Egger 2 participants 3 messages Jan 25, 2004 – Feb 20, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hija,

I just discovered that the interface doesn't account outgoing bytes, so although I'm shoveling GBs over NFS to another machine, ifconfig and /proc/net/dev both state that the card hasn't transmitted anything:

eth2 Link encap:Ethernet HWaddr 00:08:01:a3:64:97,

          inet addr:192.168.11.2  Bcast:192.168.11.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:297638 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1334930 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:45831863 (43.7 MiB)  TX bytes:0 (0.0 b)
          Interrupt:4 Base address:0xff00

Furthermore the performance is really scary slow: I'm not even getting 100Base-T speeds from an Athlon XP to my G4 PowerBook under MacOS X over a PtP connection.

What is interesting though is that the machine produces interrupt errors which only occur when the card is active:

CPU0

  0:  110545371          XT-PIC  timer
  1:          2          XT-PIC  keyboard
  2:          0          XT-PIC  cascade
  3:      35665          XT-PIC  ohci1394
  4:    4314949          XT-PIC  eth2
  8:          4          XT-PIC  rtc
 12:   87125964          XT-PIC  eth0
 14:    6035586          XT-PIC  ide0
 15:    6986897          XT-PIC  ide1
NMI:          0
LOC:  110544807
ERR:      10905
MIS:          0

And this is this output of the driver at initialisation:

r8169 Gigabit Ethernet driver 1.2 loaded
PCI: Found IRQ 4 for device 00:0d.0
r8169: PCI device 00:0d.0: unknown chip version, assuming RTL-8169
r8169: PCI device 00:0d.0: TxConfig = 0x800000
eth2: Identified chip type is 'RTL-8169'.
eth2: RealTek RTL8169 Gigabit Ethernet at 0xe093ff00, 00:08:01:a3:64:97, IRQ 4
eth2: Auto-negotiation Enabled.
eth2: 1000Mbps Full-duplex operation.

Signature · 2 lines
Servus,
       Daniel
#1 lore raw

Daniel Egger <[email protected]> :
[r8169 stats broken]

Quoted 3 lines

Furthermore the performance is really scary slow: I'm not even getting 100Base-T speeds from an Athlon XP to my G4 PowerBook under MacOS X over a PtP connection.

Try the patch above. If it compiles, it should fix the stats and you get a bugfix as an extra.

Please Cc: [email protected] on followup.

drivers/net/r8169.c +8 -5
@@ -874,7 +874,6 @@
 		     void *ioaddr)
 {
 	unsigned long dirty_tx, tx_left = 0;
-	int entry = tp->cur_tx % NUM_TX_DESC;
 
 	assert(dev != NULL);
 	assert(tp != NULL);
@@ -884,14 +883,18 @@
 	tx_left = tp->cur_tx - dirty_tx;
 
 	while (tx_left > 0) {
+		int entry = dirty_tx % NUM_TX_DESC;
+
 		if ((tp->TxDescArray[entry].status & OWNbit) == 0) {
-			dev_kfree_skb_irq(tp->
-					  Tx_skbuff[dirty_tx % NUM_TX_DESC]);
-			tp->Tx_skbuff[dirty_tx % NUM_TX_DESC] = NULL;
+			struct sk_buff *skb = tp->Tx_skbuff[entry];
+
+			tp->stats.tx_bytes += skb->len >= ETH_ZLEN ?
+					      skb->len : ETH_ZLEN;
 			tp->stats.tx_packets++;
+			dev_kfree_skb_irq(skb);
+			tp->Tx_skbuff[entry] = NULL;
 			dirty_tx++;
 			tx_left--;
-			entry++;
 		}
 	}
 
#2 lore raw
Quoted 2 lines · Francois Romieu

Try the patch above. If it compiles, it should fix the stats and you get a bugfix as an extra.

Sorry for the delay. I've not had the chance to recompile the kernel for my fileserver and restart it, yet. But in the meantime I've received another card with RTL8169S and tried it in a different machine.

The current driver in 2.4.24 and 2.6.3 will lock up the box in almost no time when under load (not a real kernel lockup but a soft one because the machine is running over NFS and the driver seems to lose packets and then rejects to transfer more). Your patch fixes this problem and the counter issue for both 2.4.24 and 2.6.3, so it probably should go in ASAP.

However there's another thing bugging me: abysmal performance. In both a switched and a direct environment the best I could get using netio was 10MB/s send and 21MB/s receive, using NFS I get just under 10MB/s, this is slower than with a 8139 el cheapo 100Mbit card.

The netio results are illogical anyway because the other side is the fileserver, which has the same card, so if one end receives 21MB/s the other end has to send equally as fast, no? :) The CPU utilization was almost zero on server and client (both Athlon XP).

Servus,
Daniel