Debian Bug report logs - #496647
netcfg: ethtool-lite incorrectly reports status of e1000e iface on HP 2510p

version graph

Package: netcfg; Maintainer for netcfg is Debian Install System Team <debian-boot@lists.debian.org>; Source for netcfg is src:netcfg.

Reported by: Frans Pop <elendil@planet.nl>

Date: Tue, 26 Aug 2008 12:39:02 UTC

Severity: normal

Tags: confirmed, patch

Found in version netcfg/1.44

Fixed in version netcfg/1.60

Done: Matt Palmer <mpalmer@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#496647; Package netcfg. Full text and rfc822 format available.

Acknowledgement sent to Frans Pop <elendil@planet.nl>:
New Bug report received and forwarded. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Frans Pop <elendil@planet.nl>
To: Debian BTS Submit <submit@bugs.debian.org>
Subject: netcfg: ethtool-lite incorrectly reports status of e1000e iface on HP 2510p
Date: Tue, 26 Aug 2008 14:38:08 +0200
[Message part 1 (text/plain, inline)]
Package: netcfg
Version: 1.44

On my HP 2510p netcfg offers the wireless interface as default even if the 
wired e1000e interface has a cable connected (and even though I did not 
load the firmware for the wireless).

Reason is that the changelog has:
INFO: eth0 is disconnected. (MII)

I compiled ethtool-lite.c with TEST set and the result when running that 
in the D-I environment was surprising.

<CABLE IS CONNECTED>
# modprobe -r e1000e
# modprobe e1000e
# ./ethtool-lite eth0
eth0 is connected.
# ip link set eth0 up
# ./ethtool-lite eth0
eth0 is disconnected. (MII)
# ./ethtool-lite eth0
eth0 is connected.
# ip link set eth0 down
# ./ethtool-lite eth0
eth0 is connected. (MII)
# ip link set eth0 up
# ./ethtool-lite eth0
eth0 is connected.
<REMOVE THE NETWORK CABLE>
# ./ethtool-lite eth0
eth0 is connected. (MII)
# ip link set eth0 down
# ./ethtool-lite eth0
eth0 is connected. (MII)

Note the randomly (?) appearing/disappearing "(MII)" and the fact that 
after the first "link up" the interface is first reported as disconnected 
while after pulling the cable the status remains connected.

After some more testing it looks like the first issue could be solved by a 
longer pause in netcfg.c after bringing the interface up and before 
calling ethtool-lite. Changing usleep(250) to sleep(2) resulted in 
correct selection of the default (a sleep of 1 was not enough).

Disadvantage is that that also results in a very long delay from a user 
PoV if other interfaces (in my case bluetooth and wireless) are tested 
first as each interface is brought up separately and has the sleep 
separately.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#496647; Package netcfg. Full text and rfc822 format available.

Acknowledgement sent to Frans Pop <elendil@planet.nl>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. Full text and rfc822 format available.

Message #10 received at 496647@bugs.debian.org (full text, mbox):

From: Frans Pop <elendil@planet.nl>
To: 496647@bugs.debian.org
Subject: Re: Bug#496647: netcfg: ethtool-lite incorrectly reports status of e1000e iface on HP 2510p
Date: Tue, 26 Aug 2008 15:55:13 +0200
[Message part 1 (text/plain, inline)]
On Tuesday 26 August 2008, Frans Pop wrote:
> After some more testing it looks like the first issue could be solved
> by a longer pause in netcfg.c after bringing the interface up and
> before calling ethtool-lite. Changing usleep(250) to sleep(2) resulted
> in correct selection of the default (a sleep of 1 was not enough).

Another option could be to _not_ bring the link up before calling 
ethtool-lite as link detection seems to work just as well when the link 
is down as when it is up, at least on this laptop. The usleep can then be 
removed as well.

The reason it was added in the first place is unclear (the changelog for 
r22513 just says "fix everything"...).
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#496647; Package netcfg. (Sat, 01 Jan 2011 03:09:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Matthew Palmer <mpalmer@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Sat, 01 Jan 2011 03:09:03 GMT) Full text and rfc822 format available.

Message #15 received at 496647@bugs.debian.org (full text, mbox):

From: Matthew Palmer <mpalmer@debian.org>
To: 496647@bugs.debian.org
Cc: control@bugs.debian.org
Subject: ethtool-lite incorrectly reports status of e1000e
Date: Sat, 1 Jan 2011 14:05:23 +1100
[Message part 1 (text/plain, inline)]
package netcfg
tag 496647 +confirmed
tag 496647 +patch
thanks

[tl;dr: Here be dragons]

Yeah, there's definitely something screwy going on here... but I'm not
entirely sure it's ethtool-lite's fault.  I get similar results to the
submitter on an e1000e-equipped laptop (Thinkpad X60s), but mii-diag also
screws up in a similar fashion: basically, if a network cable has *ever*
been plugged in and the interface brought up, mii-diag will show that the
link is established, regardless of whether the cable is connected or not,
and whether or not ip link set <up|down> has been run.

Based on this, I'm inclined to think that this isn't necessarily an
ethtool-lite problem -- it's actually more of a NIC driver problem.  To
strengthen this conclusion, I've got another laptop (Thinkpad T42) with an
e1000 NIC, and it behaves (somewhat) as one would expect:

			Cable in			Cable out

ip link set eth0 up	eth0 is connected.		eth1 is disconnected (MII).
ip link set eth0 down	eth0 is disconnected (MII)	eth1 is disconnected (MII).

Although this could well be considered a driver bug, I think there is a
workaround that could be implemented in ethtool-lite.  Basically, in the
e1000e driver, SIOCETHTOOL works.  Why do we then second-guess it and
fallback to MII whenever it says that "yes, the link is disconnected"?

The logic in ethtool-lite for determining whether to use ethtool or MII
doesn't seem right to me -- to my mind, the only time we should fall back to
MII is if ioctl(SIOCETHTOOL) *failed*, not just if it didn't affirmitively
report "link is connected".

The attached patch implements this modification.  It makes link detection
work correctly for the e1000e driver (as in, does the same thing as the
table above) on my laptop.

Another option, mooted in #591012, is to use /sys/class/net/<dev>/carrier,
which does seem awesome in the cases where it works, but does require the
interface to be up before link detection can take place, too.  As an added
bonus, it works with wireless interfaces, too (at least the iwl3945).  I'll
put more comments and a relevant patch in that bug report.

My recommendation on this bug would be for people with as many different
chipsets as possible to try my modified ethtool-lite on their machines
(especially chipsets with drivers that don't implement SIOCETHTOOL -- if any
such beasts still exist), and see whether it Does The Right Thing
everywhere.  The more adventurous option would be to put the patch in
immediately after squeeze, and see if anyone reports catastrophic network
link detection failure as a result.

The other option is to punt this whole bug report at the kernel, since the
e1000e driver obviously has some confusion in the realm of MII support.

- Matt
[ethtool_lite_link_detection_fix.patch (text/x-diff, attachment)]

Added tag(s) confirmed. Request was from Matthew Palmer <mpalmer@debian.org> to control@bugs.debian.org. (Sat, 01 Jan 2011 03:09:04 GMT) Full text and rfc822 format available.

Added tag(s) patch. Request was from Matthew Palmer <mpalmer@debian.org> to control@bugs.debian.org. (Sat, 01 Jan 2011 03:09:05 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#496647; Package netcfg. (Sun, 02 Jan 2011 18:42:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Otavio Salvador <otavio@ossystems.com.br>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Sun, 02 Jan 2011 18:42:03 GMT) Full text and rfc822 format available.

Message #24 received at 496647@bugs.debian.org (full text, mbox):

From: Otavio Salvador <otavio@ossystems.com.br>
To: Matthew Palmer <mpalmer@debian.org>, 496647@bugs.debian.org
Subject: Re: Bug#496647: ethtool-lite incorrectly reports status of e1000e
Date: Sun, 2 Jan 2011 16:39:50 -0200
Hello,

On Sat, Jan 1, 2011 at 01:05, Matthew Palmer <mpalmer@debian.org> wrote:
> My recommendation on this bug would be for people with as many different
> chipsets as possible to try my modified ethtool-lite on their machines
> (especially chipsets with drivers that don't implement SIOCETHTOOL -- if any
> such beasts still exist), and see whether it Does The Right Thing
> everywhere.  The more adventurous option would be to put the patch in
> immediately after squeeze, and see if anyone reports catastrophic network
> link detection failure as a result.

Once we branch for rc1 this could be pushed and then we upload it as
soon as we release squeeze out.

> The other option is to punt this whole bug report at the kernel, since the
> e1000e driver obviously has some confusion in the realm of MII support.

This ought to be done IMO in any case. This looks like a driver fault
and ought to be fixed if possible.


-- 
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#496647; Package netcfg. (Fri, 21 Jan 2011 02:09:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Matt Palmer <mpalmer@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Fri, 21 Jan 2011 02:09:04 GMT) Full text and rfc822 format available.

Message #29 received at 496647@bugs.debian.org (full text, mbox):

From: Matt Palmer <mpalmer@debian.org>
To: control@bugs.debian.org
Cc: 399071@bugs.debian.org, 496647@bugs.debian.org
Subject: setting package to netcfg netcfg-static, tagging 399071, tagging 496647
Date: Fri, 21 Jan 2011 13:06:31 +1100
# Automatically generated email from bts, devscripts version 2.10.35lenny7
# via tagpending 
#
# netcfg (1.60) UNRELEASED; urgency=low
#
#  * Clarify the requirements for hostnames.  Closes: #399071.
#  * Modify ethtool-lite so that it distinguishes between "ethtool failed"
#    and "ethtool says link is down".  This should reduce link up/link down
#    confusion.  Closes: #496647.
#

package netcfg netcfg-static
tags 399071 + pending
tags 496647 + pending





Added tag(s) pending. Request was from Matt Palmer <mpalmer@debian.org> to control@bugs.debian.org. (Fri, 21 Jan 2011 02:09:09 GMT) Full text and rfc822 format available.

Reply sent to Matt Palmer <mpalmer@debian.org>:
You have taken responsibility. (Sun, 06 Feb 2011 09:42:08 GMT) Full text and rfc822 format available.

Notification sent to Frans Pop <elendil@planet.nl>:
Bug acknowledged by developer. (Sun, 06 Feb 2011 09:42:08 GMT) Full text and rfc822 format available.

Message #36 received at 496647-close@bugs.debian.org (full text, mbox):

From: Matt Palmer <mpalmer@debian.org>
To: 496647-close@bugs.debian.org
Subject: Bug#496647: fixed in netcfg 1.60
Date: Sun, 06 Feb 2011 09:38:54 +0000
Source: netcfg
Source-Version: 1.60

We believe that the bug you reported is fixed in the latest version of
netcfg, which is due to be installed in the Debian FTP archive:

netcfg-static_1.60_i386.udeb
  to main/n/netcfg/netcfg-static_1.60_i386.udeb
netcfg_1.60.dsc
  to main/n/netcfg/netcfg_1.60.dsc
netcfg_1.60.tar.gz
  to main/n/netcfg/netcfg_1.60.tar.gz
netcfg_1.60_i386.udeb
  to main/n/netcfg/netcfg_1.60_i386.udeb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 496647@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Matt Palmer <mpalmer@debian.org> (supplier of updated netcfg package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sun, 06 Feb 2011 12:59:07 +1100
Source: netcfg
Binary: netcfg netcfg-static
Architecture: source i386
Version: 1.60
Distribution: unstable
Urgency: low
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Matt Palmer <mpalmer@debian.org>
Description: 
 netcfg     - Configure the network (udeb)
 netcfg-static - Configure a static network (udeb)
Closes: 399071 414117 496647 606515 610553
Changes: 
 netcfg (1.60) unstable; urgency=low
 .
   [ Matt Palmer ]
   * Increase the frequency of DHCP discover packets sent during DHCP
     configuration using udhcpc.  This should ameliorate some problems with
     DHCP configuration when a link is slow to become available.
     Thanks to Ferenc Wagner for the patch.
   * Clarify the requirements for hostnames.  Closes: #399071.
   * Modify ethtool-lite so that it distinguishes between "ethtool failed"
     and "ethtool says link is down".  This should reduce link up/link down
     confusion.  Closes: #496647.
   * Wait for up to 3 seconds (in 0.25s increments) looking for the link on
     an interface.  Add a progress bar to show the progress of this
     operation.  Closes: #414117.
   * Wait for link detection on static interface configuration.
     Closes: #606515.
   * Release DHCP lease at the completion of the install.  Closes: #610553.
 .
   [ Updated translations ]
   * Czech (cs.po) by Miroslav Kure
   * Basque (eu.po) by Piarres Beobide
   * French (fr.po) by Christian Perrier
   * Kazakh (kk.po) by Baurzhan Muftakhidinov
   * Nepali (ne.po)
   * Russian (ru.po) by Yuri Kozlov
   * Slovak (sk.po) by Ivan Masár
   * Swedish (sv.po) by Daniel Nylander
   * Telugu (te.po) by Arjuna Rao Chavala
   * Thai (th.po) by Theppitak Karoonboonyanan
Checksums-Sha1: 
 150da085b3151e44ec2346dd7951b6316ffa673d 1087 netcfg_1.60.dsc
 d9fc057133018d249e800046770e351fe057d8e5 426818 netcfg_1.60.tar.gz
 4a3fa640810e8432ec8f6d8f9443f4e9a1fb6c2b 318010 netcfg_1.60_i386.udeb
 867de966db11bd4025521b2729f61f96663e273e 243732 netcfg-static_1.60_i386.udeb
Checksums-Sha256: 
 acfaa16d8c649ba047758af690216ea31f28af6a943443209b4d9ae86da20472 1087 netcfg_1.60.dsc
 7dcead5de32a689ff5d32f7efd851f007b9c8f74b63ea1868c4e39e642e3cb1a 426818 netcfg_1.60.tar.gz
 a7b73c85a4e2c875c5f3302248df55d79458bc282999045844afce8845febf81 318010 netcfg_1.60_i386.udeb
 f27a71edc33db4f8b101cc9fa062f7fd29fccddfdcf70e9810bc2e370caa5ce6 243732 netcfg-static_1.60_i386.udeb
Files: 
 b8e61b3bd5f10588d92117eb366ff086 1087 debian-installer optional netcfg_1.60.dsc
 1bd95ab09187ce4dec5c10a939edb4cf 426818 debian-installer optional netcfg_1.60.tar.gz
 e245696aea11efe9d5f7ba89d2c70fd4 318010 debian-installer optional netcfg_1.60_i386.udeb
 9ebb07fbb04e88b68b930a199b533bc9 243732 debian-installer optional netcfg-static_1.60_i386.udeb
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iD8DBQFNTgSIBEnrTWk1E4cRAlp6AJ9dKlIC071ycb2mU4I8itgeU4ktUACeJLCf
CCr8i3SRTmBMqzl2jvsCr7E=
=0JEP
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 12 Jul 2011 07:38:28 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 16 07:36:53 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.