weblog d’un abbe

20080530

Getting 8139too to work at 100 Mbps Full Duplex

Filed under: Experiences — Tags: , , , , — abbe @ 1210

I recently switched to my RTL-8139 NIC instead of default onboard Intel NIC, after I came to know that e100 uses binary blobs. I’ve a Netgear WGT624 WiFi router (acting as switch, atm). I plug-in my desktop at a 100 Mbps switch port in the switch. So now when I connected my RTL8139 NIC to my wireless enabled wired-switch, it comes online at 10 Mbps (full-duplex)

abbe@chateau ~ $ sudo ethtool rl0
Settings for rl0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
        Advertised auto-negotiation: No
        Speed: 10Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 32
        Transceiver: internal
        Auto-negotiation: off
        Supports Wake-on: pumbg
        Wake-on: p
        Current message level: 0x00000007 (7)
        Link detected: yes

Now, I tried manually switching it 100 Mbps (full-duplex):

abbe@chateau ~ $ sudo ethtool -s rl0 speed 10
abbe@chateau ~ $ sudo ethtool rl0
Settings for rl0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
        Advertised auto-negotiation: No
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 32
        Transceiver: internal
        Auto-negotiation: off
        Supports Wake-on: pumbg
        Wake-on: p
        Current message level: 0x00000007 (7)
        Link detected: yes

Now, to automate this, I added following line into /etc/modprobe.d/options and executed update-modules.

abbe@chateau ~ $ cat /etc/modprobe.d/options
options 8139too media=0x231
abbe@chateau ~ $ sudo modprobe -r 8139too
abbe@chateau ~ $ sudo update-modules
 * Updating /etc/modprobe.conf by hand ...                                                                                                                                 [ ok ]
 * Updating modules.dep ...                                                                                                                                                [ ok ]
abbe@chateau ~ $ sudo modprobe 8139too
abbe@chateau /etc/modprobe.d $ sudo /usr/sbin/ethtool rl0
Settings for rl0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
        Advertised auto-negotiation: No
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 32
        Transceiver: internal
        Auto-negotiation: off
        Supports Wake-on: pumbg
        Wake-on: p
        Current message level: 0x00000007 (7)
        Link detected: yes

How to arrive at the number 0x231, check out modinfo 8139too and drivers/net/8139too.c source code. BtW, I just noticed that rl0 has auto-negotiation off, so I decided to turn it on, and following are the results:

abbe@chateau ~ $ sudo ethtool -s rl0 autoneg on
abbe@chateau ~ $ sudo ethtool rl0 
Settings for rl0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
        Advertised auto-negotiation: Yes
        Speed: 10Mb/s
        Duplex: Half
        Port: MII
        PHYAD: 32
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: pumbg
        Wake-on: p
        Current message level: 0x00000007 (7)
        Link detected: no
abbe@chateau ~ $ sudo ethtool -s rl0 speed 100 duplex full
abbe@chateau ~ $ sudo ethtool rl0 
Settings for rl0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 32
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: pumbg
        Wake-on: p
        Current message level: 0x00000007 (7)
        Link detected: yes

After this I tried testing network speed using iperf, and got speeds of ~ 67 Mbps. With e100, I used to get ~ 97 Mbps. Anyways this is an 3-4 year old NIC, plugged (and unused) into my desktop unused since 2-3 years. So will try testing speeds with a new NIC soon.

About these ads

4 Comments »

  1. Lets just say I’m on a Ubuntu box with RTL-8139 NIC. And I plug it to the lan socket on a router or on my wall. Will it automatically set itself up to 100 Mbps full duplex mode?

    Comment by Edwin — 20080530 @ 1348

  2. Heh Edwin, The hardware wants Wahjava to have his fun.

    Comment by nobotz — 20080530 @ 1534

  3. Chances are that it will, but if it doesn’t then you know what to do. Anyways my notebook with RTL8139? (wildcard-expression) NIC autonegotiates at 100 Mbps.

    So probably some issue with desktop NIC.

    Comment by आशीष शुक्ल — 20080530 @ 1602

  4. Yeah such things keep Wahjava’s blog alive, otherwise he doesn’t have much to say :(

    Comment by आशीष शुक्ल — 20080530 @ 1606


RSS feed for comments on this post. TrackBack URI

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

The Shocking Blue Green Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: