[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#457971: ethtool: fails to detect or set duplex correctly (tg3)



On Tue, 2010-06-01 at 09:59 -0400, Greg Wooledge wrote:
> On Sun, May 30, 2010 at 02:41:49PM +0200, Moritz Muehlenhoff wrote:
> > Hi,
> > The next release of Debian (6.0, code name Squeeze) will be based
> > on 2.6.32. Please test the current 2.6.32 from unstable/testing and tell
> > us whether the problem persists. If so, we should report it upstream
> > to the kernel.org developers.
> 
> Some time after I filed this bug report, I learned that it requires
> a non-obvious invocation to make ethtool actually set the duplex.
> Instead of "ethtool -s eth0 duplex full" one must type out all of
> "ethtool -s autoneg off speed 100 duplex full" to get it to work.

If you want to turn autoneg off, you must say so explicitly.  However,
the fact that specifying only speed or only duplex has no effect when
autoneg is on *is* a bug in ethtool.  It should result in restricting
the advertised modes.

> Here are my results on 2.6.32.  I commented out the duplex-setting
> commands in /etc/network/interfaces and rebooted on the new kernel.
> 
> img2:~# uname -a
> Linux img2 2.6.32-3-686 #1 SMP Thu Feb 25 06:14:20 UTC 2010 i686 GNU/Linux
> img2:~# mii-tool eth0
> eth0: no autonegotiation, 100baseTx-HD, link ok
> 
> This is normal for this machine.  The way the network switch is set up,
> autonegotiation detects the speed correctly (100) but the duplex
> incorrectly (should be full, detects half).
>
> (I actually did a few mii-tool and ethtool commands prior to this, so
> you're not seeing the *completely* virgin mii-tool output.  Sorry about
> that.  But it's very similar, I promise.)
> 
> Next, trying to set the duplex:
> 
> img2:~# mii-tool -F 100baseTx-FD eth0
> img2:~# mii-tool eth0
> eth0: no autonegotiation, 100baseTx-HD, link ok
> img2:~# ethtool eth0 | grep -i duplex
>         Duplex: Half
> 
> mii-tool no longer works to set the duplex on 2.6.32.  OK, fair enough.

Some Ethernet drivers can cope with you controlling the link using
mii-tool, but others will be confused by this.  I would generally advise
that you use only ethtool to control the link.

> img2:~# ethtool -s eth0 duplex full
> Cannot set new settings: Invalid argument
>   not setting duplex
> 
> This error is new, and very welcome.  If the invocation is incorrect, I'd
> rather be told there's an error.  (It might be nice if it said something
> like "You must include `autoneg off' and `speed' when setting `duplex'",
> but that's wishlist material.)
[...]

Actually ethtool is just reporting the error returned by the driver
(EINVAL, usually explained as 'Invalid argument').  This is not a change
in ethtool, and there is unfortunately no way for a driver to
communicate exactly what is invalid.

I'll reassign this back to ethtool, as it should never ignore command-
line arguments.  (In fact, as ethtool maintainer, I was already aware of
the bug and have planned to fix it.)

Ben.

-- 
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: