2004-01-25 19:31:00

by Daniel Egger

[permalink] [raw]
Subject: rtl8169 problem and 2.4.23

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.

--
Servus,
Daniel


Attachments:
signature.asc (481.00 B)
Dies ist ein digital signierter Nachrichtenteil

2004-01-25 22:08:40

by Francois Romieu

[permalink] [raw]
Subject: [PATCH] Re: rtl8169 problem and 2.4.23

Daniel Egger <[email protected]> :
[r8169 stats broken]
> 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.

--- linux-2.4.23.orig/drivers/net/r8169.c Sun Jan 25 21:00:51 2004
+++ linux-2.4.23/drivers/net/r8169.c Sun Jan 25 22:58:17 2004
@@ -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++;
}
}