em(4) on FreeBSD is sometimes annoying

Jeremy Chadwick koitsu at FreeBSD.org
Fri Aug 1 12:42:24 UTC 2008


On Fri, Aug 01, 2008 at 02:20:05PM +0200, Martin wrote:
> I don't remember anymore when I reported it the first time. I think it
> was around 4.x or something like that. The em(4) bug is still there
> after years.
> 
> Hasn't anyone really noticed yet that em(4) only appears when you boot
> FreeBSD with the interface physically attached to a switch for example?
> If you attach it later, after boot up, the interface won't power up and
> appear in the interface list (ifconfig)?
> 
> Steps to reproduce:
> 1) Switch your PC/laptop off. Really OFF, no reboot.
> 2) Disconnect the em(4) NIC from your switch.
> 3) Boot FreeBSD.
> 4) Plug in the ethernet cable.
> 5) Tataa! All leds at the NIC stay off. You won't be able to use em(4)
> unless you reboot your machine.
> 
> Something is not being initialized properly on em(4) devices, it seems. 

Generally speaking (with my other NICs, specifically Pro/1000 NICs), I
have not seen this behaviour.  The em(4) driver behaves very well and
does 802.3u auto-neg of speed/duplex properly.  I have used many
different revisions of Pro/1000 on FreeBSD and haven't seen this
behaviour.

Most commonly what you're reporting is the result of a switch upstream
which isn't fully compatible or properly doing 802.3u auto-neg.
Rebooting the machine (thus tearing down link hard, and resetting the
entire chip) often works in this situation.  You can also try setting
the speed and duplex (media and mediaopt) in your ifconfig_emX line in
rc.conf to see if that helps (on some switches it does).

The behaviour you're reporting I've seen on old 3Com XL 509x cards with
Cisco switches, for example.  I gladly await more flame mails from
people telling me "Yes, that is a known problem with Cisco switches in
the past, but it does not happen any more", but even present-day Cisco
switches we use at our workplace (alongside em(4) NICs) behave
erroneously just like "in the past".  *shrug*  Everyone has a different
experience.

> I have had 3 of 3 em(4) NICs so far, where this bug shows up. And it's
> extremely annoying on Thinkpads, when you just want to plug in your
> laptop somewhere.

I have a Thinkpad T60p.  I'll try booting FreeBSD on it next week and
see if I can reproduce the behaviour.  I'll also include what switch
brands/models are being plugged into.

-- 
| Jeremy Chadwick                                jdc at parodius.com |
| Parodius Networking                       http://www.parodius.com/ |
| UNIX Systems Administrator                  Mountain View, CA, USA |
| Making life hard for others since 1977.              PGP: 4BD6C0CB |



More information about the freebsd-stable mailing list