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

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

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.

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.

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.)

img2:~# ethtool -s eth0 autoneg off speed 100 duplex full
img2:~# mii-tool eth0
eth0: 100 Mbit, full duplex, link ok
img2:~# ethtool eth0 | grep -i duplex
        Duplex: Full

With the full invocation, ethtool is able to set the duplex correctly,
and report it correctly; mii-tool is also able to report it correctly,
even though it failed to set it.

Speed-testing with FTP:

226 Transfer complete.
2903540 bytes sent in 0.83 secs (3431.0 kB/s)

So the duplex is in fact correct.

Reply to: