Which tool should I trust, mii-tool and ethtool don't show me the same values

18,857

Solution 1

Since mii-tool is deprecated, I'd go for ethtool. Can't you check the other sides opinion of the link speed, btw?

mii-tool and ethtool are known to disagree in certain circumstances; you can find bugreports of that on a host of websites. What driver are you using? At least tg3 is known to be a subject of disagreement between the two tools.

UPDATE: Checked it for you locally, but it seems mii-tool can only report upto 100MiB/s. ethtool is therefore probably right in your situation ;-) Must be the reason it is deprecated, anyway...

Solution 2

Check dmesg. Most drivers will report the speed and duplex they negotiate at. For example:

dmesg | grep eth2

For example, our HP Proliants have onboard Broadcom NICs that produce kernel log messages like this:

bnx2: eth2 NIC Link is Up, 1000 Mbps full duplex, receive & transmit flow control ON

If your computer has been up for awhile and the kernel log buffer filled up with other stuff (it's a fixed-size FIFO), you can also check syslog. You don't say what distribution you're using, but many will log kernel messages to /var/log/messages or /var/log/syslog.

Share:
18,857

Related videos on Youtube

Dave Cheney
Author by

Dave Cheney

A chaotic neutral System Administrator with super cow powers. My weapons are: fear cynicism an almost fanatical devotion to the command line

Updated on September 17, 2022

Comments

  • Dave Cheney
    Dave Cheney almost 2 years

    Our hosting company provides all the switching infrastructure for our servers. The private network, connected to eth2 should be GbE. Recently I've been suspecting that something is misconfigured as cacti graphs never appear to show more than 100mbit of traffic on the link.

    Digging further I found that mii-tool and ethtool do not agree on the link speed.

    # mii-tool eth2
    eth2: negotiated 100baseTx-FD flow-control, link ok
    # ethtool eth2 
    Settings for eth2:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
                                1000baseT/Half 1000baseT/Full 
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
                                1000baseT/Half 1000baseT/Full 
        Advertised auto-negotiation: Yes
        Speed: 1000Mb/s
        Duplex: Full
    

    Which tool should I trust ?

    • Govindarajulu
      Govindarajulu about 15 years
      Since this is a bit Linux specific, I added a Linux tag
  • Dave Cheney
    Dave Cheney about 15 years
    The interface is a Broadcom. 04:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5751 Gigabit Ethernet PCI Express (rev 21)
  • Bill Weiss
    Bill Weiss about 15 years
    mii-tool is really unhappy on 10GE interfaces. :)
  • David Goodwin
    David Goodwin over 8 years
    ethtool and lshw both appear to be correct/reliable in my case (when mii-tool is being unreliable)