mii-tool not working with e1000e nic driver

Bug #611715 reported by Jair
30
This bug affects 6 people
Affects Status Importance Assigned to Milestone
net-tools (Fedora)
Fix Released
Medium
net-tools (Ubuntu)
Confirmed
Undecided
Jair

Bug Description

Binary package hint: net-tools

On newer kernels the e1000 nic driver was replaced by the e1000e driver.

mii-tool doesn't work with that new driver:

SIOCGMIIPHY on 'eth1' failed: Resource temporarily unavailable
SIOCGMIIREG on eth2 failed: Input/output error
SIOCGMIIREG on eth2 failed: Input/output error
  No MII transceiver present!.
SIOCGMIIREG on eth3 failed: Input/output error
SIOCGMIIREG on eth3 failed: Input/output error
  No MII transceiver present!.
SIOCGMIIREG on eth4 failed: Input/output error
SIOCGMIIREG on eth4 failed: Input/output error
  No MII transceiver present!.
SIOCGMIIREG on eth5 failed: Input/output error
SIOCGMIIREG on eth5 failed: Input/output error
  No MII transceiver present!.

hardy 8.04.4 LTS (net-tools 1.60-19ubuntu1) uses the e1000 driver and works fine. The latest lucid release uses the e1000e (net-tools 1.60-23ubuntu2) driver and it doesn' work.

Is mii-tool descontinued?

Thanks.

Revision history for this message
In , Bill (bill-redhat-bugs) wrote :

Description of problem:

[root@apone ~]# mii-tool eth0
SIOCGMIIREG on eth0 failed: Input/output error
eth0: negotiated 100baseTx-FD, link ok

It reports the 'negotiated 100base...' line no matter whether or not something is connected. This breaks the initscripts link check.

I suppose it could also be a kernel issue. Driver is:
[root@apone ~]# ethtool -i eth0
driver: e1000e
version: 0.3.3.3-k6

Also occurs on rawhide.

Version-Release number of selected component (if applicable):

net-tools-1.60-91.fc10.x86_64
kernel-2.6.28-4.fc10.x86_64

Revision history for this message
In , Andy (andy-redhat-bugs) wrote :
Download full text (3.6 KiB)

when mii-tool checks link status, this code is called (from mii-tool.c):

    200 int show_basic_mii(int sock, int phy_id)
    201 {
    202 char buf[100];
    203 int i, mii_val[32];
    204 int bmcr, bmsr, advert, lkpar;
    205
    206 /* Some bits in the BMSR are latched, but we can't rely on being
    207 the only reader, so only the current values are meaningful */
    208 mdio_read(sock, MII_BMSR);
    209 for (i = 0; i < ((verbose > 1) ? 32 : 8); i++)
    210 mii_val[i] = mdio_read(sock, i);
    211
    212 if (mii_val[MII_BMCR] == 0xffff) {
    213 fprintf(stderr, " No MII transceiver present!.\n");
    214 return -1;
    215 }

Since 'verbose' is false, we will call the SIOCGMIIREG ioctl with the commands MII_BMSR and then the commands 0-7 will be called. Those commands are:

#define MII_BMCR 0x00 /* Basic mode control register */
#define MII_BMSR 0x01 /* Basic mode status register */
#define MII_PHYSID1 0x02 /* PHYS ID 1 */
#define MII_PHYSID2 0x03 /* PHYS ID 2 */
#define MII_ADVERTISE 0x04 /* Advertisement control reg */
#define MII_LPA 0x05 /* Link partner ability reg */
#define MII_EXPANSION 0x06 /* Expansion register */
#define MII_CTRL1000 0x09 /* 1000BASE-T control */

Where is 0x7????

If we look at the sources for e1000e, we can see why -EIO is returned. From drivers/net/e1000e/netdev.c (e1000_mii_ioctl) in net-next-2.6 upstream tree:

   4347 case SIOCGMIIREG:
   4348 if (!capable(CAP_NET_ADMIN))
   4349 return -EPERM;
   4350 switch (data->reg_num & 0x1F) {
   4351 case MII_BMCR:
   4352 data->val_out = adapter->phy_regs.bmcr;
   4353 break;
   4354 case MII_BMSR:
   4355 data->val_out = adapter->phy_regs.bmsr;
   4356 break;
   4357 case MII_PHYSID1:
   4358 data->val_out = (adapter->hw.phy.id >> 16);
   4359 break;
   4360 case MII_PHYSID2:
   4361 data->val_out = (adapter->hw.phy.id & 0xFFFF);
   4362 break;
   4363 case MII_ADVERTISE:
   4364 data->val_out = adapter->phy_regs.advertise;
   4365 break;
   4366 case MII_LPA:
   4367 data->val_out = adapter->phy_regs.lpa;
   4368 break;
   4369 case MII_EXPANSION:
   4370 data->val_out = adapter->phy_regs.expansion;
   4371 break;
   4372 case MII_CTRL1000:
   4373 data->val_out = adapter->phy_regs.ctrl1000;
   4374 break;
   4375 case MII_STAT1000:
   4376 data->val_out = adapter->phy_regs.stat1000;
   4377 ...

Read more...

Revision history for this message
In , Bill (bill-redhat-bugs) wrote :

The only other wired device I have access to ATM is e100 - it doesn't throw an error.

Revision history for this message
In , Andy (andy-redhat-bugs) wrote :

Interesting. Is mii-tool always called in initscripts or only when ethtool fails.

Revision history for this message
In , Bill (bill-redhat-bugs) wrote :
Revision history for this message
In , Jiri (jiri-redhat-bugs) wrote :

Created attachment 366821
mii-tool patch

mii-tool will be checking only generic MII registers defined in <linux/mii.h>
i.e.
#define MII_BMCR 0x00 /* Basic mode control register */
#define MII_BMSR 0x01 /* Basic mode status register */
#define MII_PHYSID1 0x02 /* PHYS ID 1 */
#define MII_PHYSID2 0x03 /* PHYS ID 2 */
#define MII_ADVERTISE 0x04 /* Advertisement control reg */
#define MII_LPA 0x05 /* Link partner ability reg */
#define MII_EXPANSION 0x06 /* Expansion register */
#define MII_CTRL1000 0x09 /* 1000BASE-T control */
#define MII_STAT1000 0x0a /* 1000BASE-T status */
#define MII_ESTATUS 0x0f /* Extended Status */
#define MII_DCOUNTER 0x12 /* Disconnect counter */
#define MII_FCSCOUNTER 0x13 /* False carrier counter */
#define MII_NWAYTEST 0x14 /* N-way auto-neg test reg */
#define MII_RERRCOUNTER 0x15 /* Receive error counter */
#define MII_SREVISION 0x16 /* Silicon revision */
#define MII_RESV1 0x17 /* Reserved... */
#define MII_LBRERROR 0x18 /* Lpback, rx, bypass error */
#define MII_PHYADDR 0x19 /* PHY address */
#define MII_RESV2 0x1a /* Reserved... */
#define MII_TPISTATUS 0x1b /* TPI status for 10mbps */
#define MII_NCONFIG 0x1c /* Network interface config */

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

net-tools-1.60-95.fc11 has been pushed to the Fedora 11 testing repository. If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with
 su -c 'yum --enablerepo=updates-testing update net-tools'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-11010

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

net-tools-1.60-97.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/net-tools-1.60-97.fc12

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

net-tools-1.60-98.fc12 has been pushed to the Fedora 12 testing repository. If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with
 su -c 'yum --enablerepo=updates-testing update net-tools'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2009-11140

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

net-tools-1.60-95.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report.

Jair (jair-sega-brasil)
Changed in net-tools (Ubuntu):
assignee: nobody → Jair (jair-sega-brasil)
Revision history for this message
Alex Baker (jbaker18) wrote :

Confirmed this bug also exists in Keepalived v1.1.17 as of Ubuntu Lucid:

Dec 29 06:48:57 dmzlvs001 Keepalived_vrrp: SIOCGMIIREG on eth0 failed: Input/output error
Dec 29 06:48:57 dmzlvs001 Keepalived_healthcheckers: SIOCGMIIREG on eth0 failed: Input/output error
Dec 29 06:48:57 dmzlvs001 Keepalived_vrrp: SIOCGMIIREG on eth0 failed: Input/output error
Dec 29 06:48:57 dmzlvs001 Keepalived_healthcheckers: SIOCGMIIREG on eth0 failed: Input/output error
Dec 29 06:48:57 dmzlvs001 Keepalived_vrrp: SIOCGMIIREG on eth0 failed: Input/output error
Dec 29 06:48:57 dmzlvs001 Keepalived_healthcheckers: SIOCGMIIREG on eth0 failed: Input/output error

According to their mailing lists, this has to do with the fact that 1.1.17 uses a new strategy for network health and VRRP (mii-tool is often mentioned), which has caused those error messages to quite literally flood syslog and messages (24 hours has yielded over 21GB of logs!). It seems that e1000e dropped support for some things that mii-tool still retains in legacy form?

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in net-tools (Ubuntu):
status: New → Confirmed
Revision history for this message
Alex Muntada (alex.muntada) wrote :

Still a problem with e1000e on precise running latest 3.8 kernel:

SIOCGMIIREG on eth0 failed: Input/output error
SIOCGMIIREG on eth0 failed: Input/output error
eth0: negotiated 1000baseT-FD flow-control, link ok

Changed in net-tools (Fedora):
importance: Unknown → Medium
status: Unknown → Fix Released
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.