[PATCH] Re: rtl8169 problem and 2.4.23

From: Francois Romieu
Date: Sun Jan 25 2004 - 17:10:33 EST


Daniel Egger <degger@xxxxxxx> :
[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: netdev@xxxxxxxxxxx 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++;
}
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/