All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rene Herman <rene.herman@keyaccess.nl>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] 8139too Interframe Gap Time
Date: Wed, 10 Mar 2004 23:48:43 +0100	[thread overview]
Message-ID: <404F9B4B.5050803@keyaccess.nl> (raw)

[-- 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;

             reply	other threads:[~2004-03-10 22:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-10 22:48 Rene Herman [this message]
2004-03-10 23:01 ` [PATCH] 8139too Interframe Gap Time Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=404F9B4B.5050803@keyaccess.nl \
    --to=rene.herman@keyaccess.nl \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.