[realtek] Patch for TX timeout
Edgar Toernig
froese@gmx.de
Thu Apr 25 17:00:01 2002
Hi,
I wrote about this already in Febrary. Because the
rtl8129_start_xmit routine still contains the bug
here's a patch to fix it "the crude way" (ok for UP,
don't know for SMP).
--- rtl8139-116a.c
+++ rtl8139.c
@@ -962,6 +962,26 @@ rtl8129_start_xmit(struct sk_buff *skb,
outl(virt_to_bus(tp->tx_buf[entry]), ioaddr + TxAddr0 + entry*4);
} else
outl(virt_to_bus(skb->data), ioaddr + TxAddr0 + entry*4);
+
+#if 1 /* ET: */
+ {
+ unsigned long flags;
+
+ save_flags(flags);
+ cli();
+
+ outl(tp->tx_flag | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN),
+ ioaddr + TxStatus0 + entry*4);
+
+ if (++tp->cur_tx - tp->dirty_tx >= NUM_TX_DESC)
+ set_bit(0, &tp->tx_full);
+ else
+ netif_unpause_tx_queue(dev);
+
+ restore_flags(flags);
+ }
+#else /* original */
+
/* Note: the chip doesn't have auto-pad! */
outl(tp->tx_flag | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN),
ioaddr + TxStatus0 + entry*4);
@@ -978,6 +998,7 @@ rtl8129_start_xmit(struct sk_buff *skb,
netif_stop_tx_queue(dev);
} else
netif_unpause_tx_queue(dev);
+#endif
dev->trans_start = jiffies;
if (debug > 4)
For a description see my posting from Febrary.
I still have one problem. Though I thought it's a bug in one
of the cards I noticed that someone else reported the same
problem: 2 rtl8139, both 2.0.32 kernel with 1.16a driver,
directly connected with crossover cable. With 10mbit every-
thing works fine. With 100mbit, transfer in on direction is
fine, too. But the other direction will crawl: one card
gets looots of RX-errors. Turning the cable (a la: if it's
faulty in one direction errors will occure on the other side)
doesn't change anything. Still rx-errors (frame errors iirc)
on the same card. Any idea?
Ciao, ET.