21143 running with 220kB/sec

Bill Paul wpaul@ctr.columbia.edu
Wed Dec 15 14:00:12 1999


Kurt Huwig (kurt@huwig.de) writes:

>   Hello!
   
>   I have problems with a 21143 card

Ah yes, "a" 21143 card. Of course we all know exactly which card you're
talking about. No need for you to actually take two or three seconds to
tell us the manufacturer and model. No, we can figure it out using our
brand, shiny new telepathic mind probe helmets! Now, thanks to advanced
Brain Probing Technology (tm), we can all instantly know exactly what
you're thinking, making clear and accurate communication totally
unnecessary! Buy one now, and you'll also get a free time machine, which
will allow people to fix your problems before you have them! You'll never
even have to get up from your chair! Just sit there drooling and we'll do
all the important stuff for yo--!! *warning, excess sarcasm detected --
administering sedative*

Hunh? Oh... oooohhh... Mmmmmmm. Oh yeaaaaaaah, that's the stuff.

Ahem.

> running full duplex connected to a
> switch:
>   > cat /proc/pci      
 
>   Bus 0, device 18, function 0:
>       Ethernet controller: DEC DC21142 (rev 65).
>         Medium devsel. Fast back-to-back capable. IRQ 11. Master

>   I do a 'ttcp'-test and get about 220kB/sec. When I disconnect and
>   reconnect the machine from the switch, the full-duplex-lamp on the 
>   switch goes off and I get about 8000kB/sec.
   
>   I tested this with 2.2.10 and 2.2.13. The most recent driver was:
   
>   tulip.c:v0.91e 5/27/99 becker@cesdis.gsfc.nasa.gov

>   eth0: Digital DS21143 Tulip rev 65 at 0xdc80, 00:C0:CA:16:11:4B, IRQ 11.
>   eth0: EEPROM default media type Autosense.
>   eth0: Index #0 - Media 10baseT (#0) described by a 21142 Serial PHY (2) block.
>   eth0: Index #1 - Media 10baseT-FD (#4) described by a 21142 Serial PHY (2) block.
>   eth0: Index #2 - Media 100baseTx (#3) described by a 21143 SYM PHY (4) block.
>   eth0: Index #3 - Media 100baseTx-FD (#5) described by a 21143 SYM PHY (4) block.

Well, according to the OUI in the ethernet address, your card is made
by Alfa, Inc. I'm not sure what model though, however the media
descriptors indicate that it doesn't use an MII-based transceiver
and relies instead on the 21143's 10baseT port, 100Mbps symbol mode and
built-in NWAY autonegotiation.

>   Then I tried a RTL8139 card in the same machine and it has 8000kB/sec
>   with FD on. I tried several cards and several switches without any
>   differences.
  
>   I don't have this problems with a 21140. This card keeps the FD even
>   when disconnected/reconnected from the switch.

>   Any clues?
   
>   Kurt

Actually, yes. The info from the diag program shows the problem:

>tulip-diag.c:v1.19 10/2/99 Donald Becker (becker@cesdis.gsfc.nasa.gov)
>Index #1: Found a Digital DS21143 Tulip adapter at 0xdc80.
>Digital DS21143 Tulip chip registers at 0xdc80:
>  f8a08000 ffffffff ffffffff 004fe010 004fe210 f0000102 b3860200 f3fe0000
>  e0000000 fff583ff ffffffff 00000000 41e1d2cc ffff0001 fffbffff 8ffdc008
> Port selection is 100mbps-SYM/PCS 100baseTx scrambler, full-duplex.
> Transmit stopped, Receive stopped, full-duplex. 
>  The Rx process state is 'Stopped'.
>  The Tx process state is 'Stopped'.
>  The transmit threshold is 128.
>  The NWay status register is 41e1d2cc.

The contents of CSR14 is 0xfffbffff. The 'autoneg enable' bit is set,
which makes sense since the default media setting is 'autosense.' The
NWAY statuss word says 0x41e1d2cc, which indicates that negotiation
was completed and the chip got the link partner's code word (0x41e1)
which indicates that the link partner supports 100mbps full duplex.
This means that the driver should program the chip for 100mbps full
duplex in order to match the switch, and it fact it may believe that
it is doing just that.
 
However, there is a difference between the 21140 and 21143 relating to
how the full duplex bit in CSR6 is handled: with the 21143, when you have
autoneg turned on, the full duplex bit does not actually force the chip
into full duplex, it only controls whether or not the NWAY logic
advertises 10mbps full duplex mode. If you negotiate a full duplex mode
and you actually want to use it, you have to turn off autoneg first,
*then* set the full duplex bit in CSR6. Otherwise, you stay in half
duplex while the switch is in full-duplex, and you get cruddy performance
due to the mismatch.

What can you do? A few things:

1) Rather than using autosense, force the NIC to 100Mbps full duplex.
   NOTE: if you do this, you will have to manually program the switch
   to stay at 100Mbps full duplex too, because without the
   autonegotiation, the switch will only be able to detect the link
   speed, not the duplex mode. If you set the NIC for 100Mbps full
   duplex and do nothing else, the switch will assume 100Mbps half
   duplex and you will still have a mismatch.

2) Force the NIC to 100Mbps half duplex. The switch will also assume
   100mbps half duplex, and performance will be better. However, you
   will get collisions since you won't be in full duplex.

3) Try a newer version of the driver. I don't keep track of all the
   changes, but I'm fairly sure that 0.91e has been superseded by
   at least a few interim releases (I think there's a 0.91g now).
   Donald Becker must have run across this problem by now and is
   sure to have fixed it in a later driver version. If you try the
   latest version and it still doesn't work, send him a quick e-mail
   asking about it.

Note that this problem does not occur with 21143-based NICs that
use MII transceivers (like the Kingston KNE100TX or the D-Link
DFE-570TX, and probably olders) since in these configurations the
21143's internal autonegotiation is not used.

-Bill

-- 
=============================================================================
-Bill Paul            (212) 854-6020 | System Manager, Master of Unix-Fu
Work:         wpaul@ctr.columbia.edu | Department of Electrical Engineering
Home:  wpaul@skynet.ctr.columbia.edu | Columbia University, New York City
=============================================================================
"Mulder, toads just fell from the sky!" "I guess their parachutes didn't open."
=============================================================================