mii-tool in displays advertising and link partner fields backwards

Bug #860064 reported by James Caccese
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
net-tools (Debian)
Fix Released
Unknown
net-tools (Ubuntu)
Fix Released
Medium
Unassigned
Lucid
Won't Fix
Medium
Unassigned
Precise
Won't Fix
Medium
Unassigned
Trusty
Triaged
Medium
Unassigned
Utopic
Won't Fix
Medium
Unassigned

Bug Description

I have a gigabit ethernet card in my box, but only fast ethernet switch. When I use mii-tool, it report that it my card only advertises up to a 100baseTx link, but that my switch advertises up to a 1000baseT link. These are backwards. ethtool gets it right.

Since newer versions (with newer releases) only have a single change (an updated header list), I assume those versions suffer the same bug.

See the listing below of running mii-tool vs ethtool on the same interface, and note that advertised and link partner fields are reversed in the two tools:

jwcacces@__myhostname__:~$ lsb_release -rd
Description: Ubuntu 10.04.3 LTS
Release: 10.04

jwcacces@__myhostname__:~$ dpkg -S `which mii-tool`
net-tools: /sbin/mii-tool

jwcacces@__myhostname__:~$ dpkg -p net-tools
Package: net-tools
Priority: important
Section: net
Installed-Size: 1044
Maintainer: Ubuntu Core Developers <email address hidden>
Architecture: amd64
Version: 1.60-23ubuntu2
Replaces: ja-trans (<= 0.8-2), netbase (<< 4.00)
Depends: libc6 (>= 2.4)
Conflicts: ja-trans (<= 0.8-2)
Size: 259342
Description: The NET-3 networking toolkit
 This package includes the important tools for controlling the network
 subsystem of the Linux kernel. This includes arp, ifconfig, netstat,
 rarp, nameif and route. Additionally, this package contains utilities
 relating to particular network hardware types (plipconfig, slattach,
 mii-tool) and advanced aspects of IP configuration (iptunnel, ipmaddr).
 .
 In the upstream package 'hostname' and friends are included. Those are
 not installed by this package, since there is a special "hostname*.deb".
Original-Maintainer: net-tools Team <email address hidden>

jwcacces@__myhostname__:~$ apt-cache policy net-tools
net-tools:
  Installed: 1.60-23ubuntu2
  Candidate: 1.60-23ubuntu2
  Version table:
 *** 1.60-23ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ lucid/main Packages
        100 /var/lib/dpkg/status

jwcacces@__myhostname__:~$ dpkg -S `which ethtool`
ethtool: /usr/sbin/ethtool

jwcacces@__myhostname__:~$ dpkg -p ethtool
Package: ethtool
Priority: optional
Section: utils
Installed-Size: 268
Maintainer: Ubuntu Developers <email address hidden>
Architecture: amd64
Version: 6+20091202-1ubuntu1
Depends: libc6 (>= 2.7)
Conflicts: sparc-utils (<< 1.9-1)
Size: 74094
Description: display or change Ethernet device settings
 ethtool can be used to query and change settings such as speed, auto-
 negotiation and checksum offload on many network devices, especially
 Ethernet devices.
Homepage: http://sourceforge.net/projects/gkernel/
Original-Maintainer: Anibal Monsalve Salazar <email address hidden>

jwcacces@__myhostname__:~$ apt-cache policy ethtool
ethtool:
  Installed: 6+20091202-1ubuntu1
  Candidate: 6+20091202-1ubuntu1
  Version table:
 *** 6+20091202-1ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main Packages
        100 /var/lib/dpkg/status
     6+20091202-1 0
        500 http://us.archive.ubuntu.com/ubuntu/ lucid/main Packages

jwcacces@__myhostname__:~$ sudo mii-tool -v eth1
eth1: negotiated 100baseTx-FD flow-control, link ok
  product info: vendor 00:07:32, model 17 rev 3
  basic mode: autonegotiation enabled
  basic status: autonegotiation complete, link ok
  capabilities: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
  link partner: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control

jwcacces@__myhostname__:~$ sudo ethtool eth1
Settings for eth1:
        Supported ports: [ TP MII ]
        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 pause frame use: No
        Advertised auto-negotiation: Yes
        Link partner advertised link modes: 10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
        Link partner advertised pause frame use: No
        Link partner advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: pumbg
        Wake-on: g
        Current message level: 0x00000033 (51)
        Link detected: yes

Revision history for this message
James Page (james-page) wrote :

Something is definitely not consistent:

ubuntu@churel:~$ sudo mii-tool -v eth0
eth0: negotiated 1000baseT-FD flow-control, link ok
  product info: vendor 00:d8:97, model 34 rev 0
  basic mode: autonegotiation enabled
  basic status: autonegotiation complete, link ok
  capabilities: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  advertising: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
  link partner: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
ubuntu@churel:~$ sudo ethtool eth0
Settings for eth0:
 Supported ports: [ TP ]
 Supported link modes: 10baseT/Half 10baseT/Full
                         100baseT/Half 100baseT/Full
                         1000baseT/Half 1000baseT/Full
 Supported pause frame use: No
 Supports auto-negotiation: Yes
 Advertised link modes: 10baseT/Half 10baseT/Full
                         100baseT/Half 100baseT/Full
                         1000baseT/Half 1000baseT/Full
 Advertised pause frame use: Symmetric
 Advertised auto-negotiation: Yes
 Link partner advertised link modes: 10baseT/Half 10baseT/Full
                                      100baseT/Half 100baseT/Full
                                      1000baseT/Full
 Link partner advertised pause frame use: Symmetric Receive-only
 Link partner advertised auto-negotiation: Yes
 Speed: 1000Mb/s
 Duplex: Full
 Port: Twisted Pair
 PHYAD: 1
 Transceiver: internal
 Auto-negotiation: on
 MDI-X: on
 Supports Wake-on: g
 Wake-on: g
 Current message level: 0x000000ff (255)
          drv probe link timer ifdown ifup rx_err tx_err
 Link detected: yes
ubuntu@churel:~$

Revision history for this message
James Page (james-page) wrote :

Appears to be resolved in upstream trunk codebase; looking at commits.

Revision history for this message
James Page (james-page) wrote :

Looks like:

    printf("\n advertising: %s", media_list(advert, lpa2 >> 2, 0));
    if (lkpar & MII_AN_ABILITY_MASK)
        printf("\n link partner:%s", media_list(lkpar, bmcr2, 0));

should be

    printf("\n advertising: %s", media_list(advert, bmcr2, 0));
    if (lkpar & LPA_ABILITY_MASK)
        printf("\n link partner:%s", media_list(lkpar, lpa2 >> 2, 0));

Changed in net-tools (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
status: Confirmed → Triaged
Revision history for this message
James Page (james-page) wrote :
Changed in net-tools (Ubuntu Trusty):
status: New → Triaged
Changed in net-tools (Ubuntu Precise):
status: New → Triaged
Changed in net-tools (Ubuntu Lucid):
status: New → Triaged
importance: Undecided → Medium
Changed in net-tools (Ubuntu Precise):
importance: Undecided → Medium
Changed in net-tools (Ubuntu Trusty):
importance: Undecided → Medium
summary: - mii-tool in 10.04LTS displays advertising and link partner fields
- backwards
+ mii-tool in displays advertising and link partner fields backwards
Changed in net-tools (Debian):
status: Unknown → New
Revision history for this message
Rolf Leggewie (r0lf) wrote :

lucid has seen the end of its life and is no longer receiving any updates. Marking the lucid task for this ticket as "Won't Fix".

Changed in net-tools (Ubuntu Lucid):
status: Triaged → Won't Fix
Changed in net-tools (Debian):
status: New → Fix Released
Revision history for this message
Rolf Leggewie (r0lf) wrote :

utopic has seen the end of its life and is no longer receiving any updates. Marking the utopic task for this ticket as "Won't Fix".

Changed in net-tools (Ubuntu Utopic):
status: Triaged → Won't Fix
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Fixed since yakkety, so setting the Dev release to Fix released

Changed in net-tools (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote :

The Precise Pangolin has reached end of life, so this bug will not be fixed for that release

Changed in net-tools (Ubuntu Precise):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.