Bug#525296: Cannot set tg3 interface to full duplex

2009-04-24 Thread Greg Wooledge
On Fri, Apr 24, 2009 at 12:29:23AM +0100, Ben Hutchings wrote:
 Do you also expect to get a gigabit link or only 100 megabit?

The other end is set to 100/full.  That is what I want to set the NIC to.

 Please run mii-tool -v eth0.

img2:~# uptime
 08:37:59 up 1 min,  1 user,  load average: 0.28, 0.12, 0.04
img2:~# uname -a
Linux img2 2.6.26-2-686 #1 SMP Thu Mar 26 01:08:11 UTC 2009 i686 GNU/Linux
img2:~# mii-tool -v eth0
eth0: no autonegotiation, 100baseTx-HD, link ok
  product info: vendor 00:08:18, model 24 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:  100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
  link partner: 100baseTx-HD


 Is autonegotiation enabled at the other end of the link?

No.  The networking department here has a Policy of not using
autonegotiation, ever.  Every single machine is expected to be
set explicitly to the speed and duplex of the port.  You REALLY
don't want to know what I did on the machines that move around
from place to place on wheeled carts.  Truly.

 So you enable autonegotiation and then use mii-tool to override it
 behind the driver's back, and you expect this to work somehow?

I have been Googling intermittently for things like Debian tg3 force
full duplex for years and I have NEVER found a straight answer to
the relatively simple question of How do you force a NIC to 100/full?

I am not explicitly setting autonegotiation.  The driver module is
probably doing so when it's loaded by udev or discover or magical
leprechauns or whatever it is that Linux/Debian are using this year.
And since nobody can tell me how NOT to do that, that's what ends up
happening.

If you can tell me how to set my NIC to 100/full in the Correct Debian
Way, then I will happily try your suggestions.

 Forget
 it; this is not a bug.  Either use autonegotiation and fix whatever is
 wrong with the other end of the link, or disable autonegotiation and
 force settings with ethtool.

That's precisely what I don't know HOW to do.  How do I disable
autonegotiation?  Where do I do it?  In /etc/network/interfaces?
What's the syntax?  Do I have to set driver-module-specific black
magic options?  Where do I do that?  Which man page documents all
of this stuff?

#debian seems to think I can try ethtool -s eth0 autoneg off duplex full.
So let's give that a whirl:

img2:~# ethtool -s eth0 autoneg off duplex full
img2:~# ethtool eth0 | grep -i duplex
Duplex: Full
img2:~# cd /usr/bin
img2:/usr/bin# ftp vue10
...
226 Transfer complete.
4508444 bytes sent in 0.79 secs (5599.2 kB/s)

Wow, I think that actually worked.

mg2:/usr/bin# mii-tool -v eth0
eth0: 100 Mbit, full duplex, link ok
  product info: vendor 00:08:18, model 24 rev 0
  basic mode:   100 Mbit, full duplex
  basic status: link ok
  capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  advertising:  100baseTx-FD flow-control

Final test:

img2:/usr/bin# tail /etc/network/interfaces 

# The primary network interface
allow-hotplug eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 139.137.100.23
netmask 255.255.255.0
gateway 139.137.100.100
up ethtool -s eth0 autoneg off duplex full
# up sleep 5; mii-tool -F 100baseTx-FD eth0

img2:/usr/bin# shutdown -r now
...

...

...


OK, that didn't work.  I walked over to it, found it stuck on
resolving every single hostname in /etc/exports and timing out.
Individually.  Obviously there was no working network.  Rebooted
into single-user mode and confirmed that eth0 wasn't working.

So, now, the REALLY final test:

img2:~# tail /etc/network/interfaces 

# The primary network interface
allow-hotplug eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 139.137.100.23
netmask 255.255.255.0
gateway 139.137.100.100
up ethtool -s eth0 autoneg off speed 100 duplex full
# up sleep 5; mii-tool -F 100baseTx-FD eth0

img2:~# shutdown -r now
...

img2:~# uname -a
Linux img2 2.6.26-2-686 #1 SMP Thu Mar 26 01:08:11 UTC 2009 i686 GNU/Linux
img2:~# mii-tool -v eth0
eth0: 100 Mbit, full duplex, link ok
  product info: vendor 00:08:18, model 24 rev 0
  basic mode:   100 Mbit, full duplex
  basic status: link ok
  capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  advertising:  100baseTx-FD flow-control

OK!  We're back in action.

With any luck, Google will index this and the next poor sap who has
to try to figure out How do I set my NIC to full duplex in Debian?
will find this.

(Not that this will answer every question.  I'm sure it will still fail
for lots of other people, because the correct answer seems to be something
along the lines of It depends on which driver your NIC uses.  You're
probably screwed.  Try some other operating system and pray, or buy a
different NIC and pray, or both.)



-- 
To UNSUBSCRIBE, email to 

Bug#525296: Cannot set tg3 interface to full duplex

2009-04-24 Thread Ben Hutchings
On Fri, 2009-04-24 at 09:33 -0400, Greg Wooledge wrote:
 On Fri, Apr 24, 2009 at 12:29:23AM +0100, Ben Hutchings wrote:
  Do you also expect to get a gigabit link or only 100 megabit?
 
 The other end is set to 100/full.  That is what I want to set the NIC to.
 
  Please run mii-tool -v eth0.
 
 img2:~# uptime
  08:37:59 up 1 min,  1 user,  load average: 0.28, 0.12, 0.04
 img2:~# uname -a
 Linux img2 2.6.26-2-686 #1 SMP Thu Mar 26 01:08:11 UTC 2009 i686 GNU/Linux
 img2:~# mii-tool -v eth0
 eth0: no autonegotiation, 100baseTx-HD, link ok
   product info: vendor 00:08:18, model 24 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:  100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
   link partner: 100baseTx-HD

As you can see, the other end only advertised 100BASE-T half-duplex, so
that was the only possible result of autonegotiation.

  Is autonegotiation enabled at the other end of the link?
 
 No.  The networking department here has a Policy of not using
 autonegotiation, ever.

My commiserations.  Do they know that 1000BASE-T does not work without
autonegotiation?

[...]
 I have been Googling intermittently for things like Debian tg3 force
 full duplex for years and I have NEVER found a straight answer to
 the relatively simple question of How do you force a NIC to 100/full?
 
 I am not explicitly setting autonegotiation.  The driver module is
 probably doing so when it's loaded by udev or discover or magical
 leprechauns or whatever it is that Linux/Debian are using this year.

Which is absolutely the correct default for a multi-speed NIC.

[...]
 So, now, the REALLY final test:
 
 img2:~# tail /etc/network/interfaces 
 
 # The primary network interface
 allow-hotplug eth0
 #iface eth0 inet dhcp
 iface eth0 inet static
 address 139.137.100.23
 netmask 255.255.255.0
 gateway 139.137.100.100
 up ethtool -s eth0 autoneg off speed 100 duplex full
 # up sleep 5; mii-tool -F 100baseTx-FD eth0

This is the sensible approach now.

In the current (unstable) package of ethtool I have added an ifupdown
hook so these settings can be specified in interfaces without explicitly
running ethtool.

[...]
 (Not that this will answer every question.  I'm sure it will still fail
 for lots of other people, because the correct answer seems to be something
 along the lines of It depends on which driver your NIC uses.  You're
 probably screwed.  Try some other operating system and pray, or buy a
 different NIC and pray, or both.)

The ethtool command above should work for just about any Ethernet NIC
under Linux, though obviously some drivers have bugs.

Ben.



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


Bug#525296: Cannot set tg3 interface to full duplex

2009-04-23 Thread Greg Wooledge
Package: linux-image-2.6.26-1-686
Version: 2.6.26-13lenny2

Neither mii-tool nor ethtool can set my network interface to full
duplex.  This is a huge problem here.

img2:/usr/bin# mii-tool eth0
eth0: no autonegotiation, 100baseTx-HD, link ok
img2:/usr/bin# mii-tool -F 100baseTx-FD eth0
img2:/usr/bin# mii-tool 
eth0: no autonegotiation, 100baseTx-HD, link ok

mg2:/usr/bin# ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
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 auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Half
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: g
Wake-on: g
Current message level: 0x00ff (255)
Link detected: yes
img2:/usr/bin# ethtool -s eth0 duplex full
img2:/usr/bin# ethtool eth0 | grep -i duplex
Duplex: Half

img2:/usr/bin# dmesg | grep eth0
[3.876281] eth0: Tigon3 [partno(N/A) rev 4201 PHY(5750)] (PCI Express) 
10/100/1000Base-T Ethernet 00:1b:78:39:80:33
[3.876281] eth0: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[1] WireSpeed[1] 
TSOcap[1]
[3.876281] eth0: dma_rwctrl[7618] dma_mask[64-bit]
[   22.658189] tg3: eth0: Link is up at 100 Mbps, half duplex.
[   22.658321] tg3: eth0: Flow control is off for TX and off for RX.
[   25.861528] tg3: eth0: Link is down.
[   27.903339] tg3: eth0: Link is up at 100 Mbps, half duplex.
[   27.903339] tg3: eth0: Flow control is off for TX and off for RX.
[   33.220687] eth0: no IPv6 routers present
[2170329.216069] tg3: eth0: Link is down.
[2170331.343752] tg3: eth0: Link is up at 100 Mbps, half duplex.
[2170331.343752] tg3: eth0: Flow control is off for TX and off for RX.
[2170387.843919] tg3: eth0: Link is down.
[2170389.865407] tg3: eth0: Link is up at 100 Mbps, half duplex.
[2170389.865407] tg3: eth0: Flow control is off for TX and off for RX.
[2170471.002564] tg3: eth0: Link is down.
[2170473.081719] tg3: eth0: Link is up at 100 Mbps, half duplex.
[2170473.081719] tg3: eth0: Flow control is off for TX and off for RX.

I'll try -2-686 but I don't expect it to work differently.  Then I
suppose I'll try building custom kernels, or maybe I'll try grabbing
the tg3 driver from 2.6.18 or 2.6.8, back when things worked.



-- 
To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#525296: Cannot set tg3 interface to full duplex

2009-04-23 Thread Ben Hutchings
On Thu, 2009-04-23 at 10:23 -0400, Greg Wooledge wrote:
 Package: linux-image-2.6.26-1-686
 Version: 2.6.26-13lenny2
 
 Neither mii-tool nor ethtool can set my network interface to full
 duplex.  This is a huge problem here.

Do you also expect to get a gigabit link or only 100 megabit?

 img2:/usr/bin# mii-tool eth0
 eth0: no autonegotiation, 100baseTx-HD, link ok
 img2:/usr/bin# mii-tool -F 100baseTx-FD eth0
 img2:/usr/bin# mii-tool 
 eth0: no autonegotiation, 100baseTx-HD, link ok

Please run mii-tool -v eth0.

 mg2:/usr/bin# ethtool eth0
 Settings for eth0:
 Supported ports: [ TP ]
 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 auto-negotiation: Yes
 Speed: 100Mb/s
 Duplex: Half
 Port: Twisted Pair
 PHYAD: 1
 Transceiver: internal
 Auto-negotiation: on
 Supports Wake-on: g
 Wake-on: g
 Current message level: 0x00ff (255)
 Link detected: yes
 img2:/usr/bin# ethtool -s eth0 duplex full
 img2:/usr/bin# ethtool eth0 | grep -i duplex
 Duplex: Half

Is autonegotiation enabled at the other end of the link?

Ben.



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