* [PATCH] 8139too Interframe Gap Time
@ 2004-03-10 22:48 Rene Herman
2004-03-10 23:01 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Rene Herman @ 2004-03-10 22:48 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Linux Kernel
[-- Attachment #1: Type: text/plain, Size: 834 bytes --]
Hi Jeff,
in drivers/net/8139too.c, we have:
/* Check this value: the documentation for IFG contradicts ifself. */
RTL_W32 (TxConfig, rtl8139_tx_config);
I see that in older versions of the documentation there indeed were some
contradictions but the current version 1.4:
ftp://210.51.181.211/cn/nic/rtl8139abcd8130810xseries/rtl8139cspec_1.4.pdf
clears it up and it seems 8139too guessed wrong. I have verified that
realtek's own windows 9x driver agrees with the documentation.
No equipment to actually measure the IFG and no difference in network
behaviour shows up on a good 100Mbit-FD switch connected LAN, but it
does on an el-cheapo 10Mbit-HD hub connected LAN. Without attached
patch the packet and collision counters are basically the same; with
patch, the latter is only some 70% of the former. Hurray!
Rene.
[-- Attachment #2: linux-2.6.4-rc2-mm1_8139too-IFG.diff --]
[-- Type: text/plain, Size: 1494 bytes --]
--- linux-2.6.4-rc2-mm1/drivers/net/8139too.c.orig 2004-03-10 21:01:08.000000000 +0100
+++ linux-2.6.4-rc2-mm1/drivers/net/8139too.c 2004-03-10 21:01:14.000000000 +0100
@@ -383,8 +383,14 @@
/* Bits in TxConfig. */
enum tx_config_bits {
- TxIFG1 = (1 << 25), /* Interframe Gap Time */
- TxIFG0 = (1 << 24), /* Enabling these bits violates IEEE 802.3 */
+
+ /* Interframe Gap Time. Only TxIFG96 doesn't violate IEEE 802.3 */
+ TxIFGShift = 24,
+ TxIFG84 = (0 << TxIFGShift), /* 8.4us / 840ns (10 / 100Mbps) */
+ TxIFG88 = (1 << TxIFGShift), /* 8.8us / 880ns (10 / 100Mbps) */
+ TxIFG92 = (2 << TxIFGShift), /* 9.2us / 920ns (10 / 100Mbps) */
+ TxIFG96 = (3 << TxIFGShift), /* 9.6us / 960ns (10 / 100Mbps) */
+
TxLoopBack = (1 << 18) | (1 << 17), /* enable loopback test mode */
TxCRC = (1 << 16), /* DISABLE appending CRC to end of Tx packets */
TxClearAbt = (1 << 0), /* Clear abort (WO) */
@@ -716,7 +722,7 @@
#endif
static const unsigned int rtl8139_tx_config =
- (TX_DMA_BURST << TxDMAShift) | (TX_RETRY << TxRetryShift);
+ TxIFG96 | (TX_DMA_BURST << TxDMAShift) | (TX_RETRY << TxRetryShift);
static void __rtl8139_cleanup_dev (struct net_device *dev)
{
@@ -1393,8 +1399,6 @@
tp->rx_config = rtl8139_rx_config | AcceptBroadcast | AcceptMyPhys;
RTL_W32 (RxConfig, tp->rx_config);
-
- /* Check this value: the documentation for IFG contradicts ifself. */
RTL_W32 (TxConfig, rtl8139_tx_config);
tp->cur_rx = 0;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] 8139too Interframe Gap Time
2004-03-10 22:48 [PATCH] 8139too Interframe Gap Time Rene Herman
@ 2004-03-10 23:01 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2004-03-10 23:01 UTC (permalink / raw)
To: Rene Herman; +Cc: Linux Kernel
Rene Herman wrote:
> Hi Jeff,
>
> in drivers/net/8139too.c, we have:
>
> /* Check this value: the documentation for IFG contradicts ifself. */
> RTL_W32 (TxConfig, rtl8139_tx_config);
>
> I see that in older versions of the documentation there indeed were some
> contradictions but the current version 1.4:
>
> ftp://210.51.181.211/cn/nic/rtl8139abcd8130810xseries/rtl8139cspec_1.4.pdf
>
> clears it up and it seems 8139too guessed wrong. I have verified that
> realtek's own windows 9x driver agrees with the documentation.
>
> No equipment to actually measure the IFG and no difference in network
> behaviour shows up on a good 100Mbit-FD switch connected LAN, but it
> does on an el-cheapo 10Mbit-HD hub connected LAN. Without attached
> patch the packet and collision counters are basically the same; with
> patch, the latter is only some 70% of the former. Hurray!
Nice!
I'm glad somebody finally got around to doing this :)
I'll give this some testing (and put it in Andrew's -mm for that reason
as well), and then apply it.
Thanks,
Jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-03-10 23:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-10 22:48 [PATCH] 8139too Interframe Gap Time Rene Herman
2004-03-10 23:01 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox