Just moozing

Before you can check your notes, you must make them…

Ethernet woes

leave a comment »

I am doing my spring cleaning, and that included getting rid of an old machine in the office. It had 200GB+ of data on it, so some copying was needed. Since I have upgraded to a gigabit switch since last time I used it, it was time to activate the gigabit NIC – or so I though.

The hardware

The machine itself is a 2.8 GHz Pentium 4 with an Asus P4P800 motherboard and build-in 10/100/1000 ethernet. It used to be a gamer PC, but not anymore.

The adapters

$ lspci
...
02:05.0 Ethernet controller: 3Com Corporation 3c940 10/100/1000Base-T [Marvell] (rev 12)
02:0a.0 Ethernet controller: ADMtek NC100 Network Everywhere Fast Ethernet 10/100 (rev 11)

And a cool trick that I discovered today

$ lspci -k
...
02:05.0 Ethernet controller: 3Com Corporation 3c940 10/100/1000Base-T [Marvell] (rev 12)
Subsystem: ASUSTeK Computer Inc. A7V600/P4P800/K8V motherboard
Kernel driver in use: skge
02:0a.0 Ethernet controller: ADMtek NC100 Network Everywhere Fast Ethernet 10/100 (rev 11)
Subsystem: Accton Technology Corporation Device ec02
Kernel driver in use: tulip

This shows which modules that have claimed a certain device. We have two NICs; a cheap spare I put in long ago (on eth2), and the built-in gigabit device (on eth3). Eth2 is working properly at 100 Mb.

Eth3 has no IP address and the diodes are turned off. I notice that the diodes on the NIC blinks from time to time, but nothing on the switch. That is a first for me, so I start digging.

Troubleshooting

Checking and double checking cables changes nothing, and there is not much to find using “dmesg” or in the logs.

Running “modinfo skge” tell me that the driver is version 1.14 and it has a debug options.
Reloading the driver

$ rmmod skge
$ modprobe -v skge debug=16

Dmesg now start to contain some information

..
[ 4491.840104] skge: 1.14 addr 0xfeafc000 irq 22 chip Yukon rev 1
[ 4491.858030] skge 0000:02:05.0: eth0: addr 00:0c:6e:9b:ad:5f
[ 4491.966080] udevd[3409]: renamed network interface eth0 to eth3

The first I did this, syslog had entries about link up followed by link down a second later along with blinks on the NIC. Now I can only force it when doing an “ifup eth3”. Which results some interesting entries in syslog


...

[ 5526.968398] skge 0000:02:05.0: eth3: phy interrupt status 0x1c40 0xbc40
[ 5526.969056] skge 0000:02:05.0: eth3: Link is up at 1000 Mbps, full duplex, flow control none
... (tx stuff) ...
[ 5528.094434] skge 0000:02:05.0: eth3: phy interrupt status 0x600 0x8140
[ 5528.094460] skge 0000:02:05.0: eth3: Link is down

The interface should not the the link state just by ifup or ifdown. My current theory is that we have an example of bad auto-negotiation. Googling a bit, I find some examples using ethtool to manually set speed and auto-negotiation.

ethtool is the second cool thing I found today. It gives very good control of setting ethernet parameters. I wonder why I have not had the need before.

Using ethtool I was able to get the NIC up and running with diodes,  DHCP and all


$ ethtool -s eth3 duplex half speed 100 autoneg off

Just a warning, I also find that setting the parameters wrong, like, say, 1000 Mb, cause the PC to lock up, and a reboot is necessary.

The conclusion is that I have some sort of driver issue. Searching in that direction led me to this bug report, which mostly confirms the idea.

 

Solutions

First attempt was to no use skge, but sk98lin which was discussed a lot some year ago. skge should replace sk98lin, but for some NICs the old is apparently better. I found a nice DKMS package dated 2012 from here, installed it and the module did not claim the device. I did not find a viable solution with sk98lin at all.

Last suggestion is to reinstall to latest kernel 3.9,4 as describe in my post about the x230. Hopefully some issue has been solved and skge just works out of the box.

Perhaps I could settle for 2 times 100 Mb by doing bonding…

Advertisements

Written by moozing

June 1, 2013 at 09:00

Posted in Tech

Tagged with , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: