All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] Re: rtl8169 problem and 2.4.23
@ 2004-02-21 13:43 Francois Romieu
  0 siblings, 0 replies; 3+ messages in thread
From: Francois Romieu @ 2004-02-21 13:43 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev, Linux Kernel Mailinglist, Daniel Egger

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

Jeff,

  can you push the attached patch directly to both 2.6.x and 2.4.x ?
It will exhibit an offset of 3 lines against 2.4.x but it works the same
on 2.4.x and on 2.6.x. The fix already exists in -mm/-netdev serie.

Daniel Egger <degger@fhm.edu> confirmed I did not manage to add a giant
typo in a 4 lines patch. When hit, this bug is more or less a killer.

Daniel, I have no clear idea for the performance issues. Actually I am more
concerned with the stability side of this driver, especially in the new,
shamelessly hacked, branch of the driver. I'll probably regenerate a set
of patches and spam^W reach the testers to have a new data point.

--
Ueimor

[-- Attachment #2: r8169-tx-desc-overflow.patch --]
[-- Type: text/plain, Size: 1210 bytes --]

Assume tp->dirty_tx = NUM_TX_DESC/2, tp->cur_tx = NUM_TX_DESC - 1,
watch "entry" go beyond NUM_TX_DESC. This bug was copied from the 
(2.6.x only) sis190 driver where it is now fixed.
Stats are fixed as an extra bonus.


diff -Nrup drivers/net/r8169.c.orig drivers/net/r8169.c
--- drivers/net/r8169.c.orig	Thu Dec 18 03:58:50 2003
+++ drivers/net/r8169.c	Sat Feb 21 14:11:31 2004
@@ -871,7 +871,6 @@ rtl8169_tx_interrupt(struct net_device *
 		     void *ioaddr)
 {
 	unsigned long dirty_tx, tx_left = 0;
-	int entry = tp->cur_tx % NUM_TX_DESC;
 
 	assert(dev != NULL);
 	assert(tp != NULL);
@@ -881,14 +880,18 @@ rtl8169_tx_interrupt(struct net_device *
 	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++;
 		}
 	}
 

^ permalink raw reply	[flat|nested] 3+ messages in thread
* rtl8169 problem and 2.4.23
@ 2004-01-25 19:32 Daniel Egger
  2004-01-25 22:07 ` [PATCH] " Francois Romieu
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Egger @ 2004-01-25 19:32 UTC (permalink / raw)
  To: Linux Kernel Mailinglist

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

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

[-- Attachment #2: Dies ist ein digital signierter Nachrichtenteil --]
[-- Type: application/pgp-signature, Size: 481 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-02-21 13:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-21 13:43 [PATCH] Re: rtl8169 problem and 2.4.23 Francois Romieu
  -- strict thread matches above, loose matches on Subject: below --
2004-01-25 19:32 Daniel Egger
2004-01-25 22:07 ` [PATCH] " Francois Romieu
2004-02-20 12:11   ` Daniel Egger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.