From nobody@FreeBSD.org  Mon Feb 20 05:04:02 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 84FA316A420
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 20 Feb 2006 05:04:02 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 36B4843D45
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 20 Feb 2006 05:04:02 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k1K541PW070529
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 20 Feb 2006 05:04:01 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k1K541Mu070502;
	Mon, 20 Feb 2006 05:04:01 GMT
	(envelope-from nobody)
Message-Id: <200602200504.k1K541Mu070502@www.freebsd.org>
Date: Mon, 20 Feb 2006 05:04:01 GMT
From: Chris Elsworth <chris@shagged.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: /src/sys/dev/em/if_em.c 1.112 breaks interfaces
X-Send-Pr-Version: www-2.3

>Number:         93586
>Category:       kern
>Synopsis:       [em] /src/sys/dev/em/if_em.c 1.112 breaks interfaces
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    glebius
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 20 05:10:02 GMT 2006
>Closed-Date:    Fri Mar 17 21:42:23 GMT 2006
>Last-Modified:  Fri Mar 17 21:42:23 GMT 2006
>Originator:     Chris Elsworth
>Release:        7.0-CURRENT
>Organization:
>Environment:
FreeBSD netboot0.newzbin.com 7.0-CURRENT FreeBSD 7.0-CURRENT #6: Mon Feb 20 04:34:03 UTC 2006     root@netboot0.newzbin.com:/usr/obj/usr/src/sys/X4100_BOOTSRV  amd64 
>Description:
Upon supping to HEAD tonight, I found that my if_em's in the
Sun Fire x4100 I was fiddling on no longer brought up the link after
they were assigned an IP:

# ifconfig em1 && ifconfig em1 192.168.201.112 && sleep 5 && ifconfig em1
em1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        options=8b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWCSUM>
        ether 00:14:4f:20:4f:2d
        media: Ethernet autoselect (1000baseTX <full-duplex>)
        status: active
em1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=8b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWCSUM>
        inet 192.168.201.112 netmask 0xffffff00 broadcast 192.168.201.255
        ether 00:14:4f:20:4f:2d
        media: Ethernet autoselect
        status: no carrier

I realise there may be a nominal delay until the carrier comes back,
but it never does.

After some experimentation, I discovered that revision 1.112 is responsible
for this. If I check out 1.111 and build it as a module, the system is fine.

# kldunload if_em
# kldload if_em_1.111.ko
.
em1: <Intel(R) PRO/1000 Network Connection Version - 3.2.18> port 0x9800-0x983f mem 0xfbfc0000-0xfbfdffff irq 27 at device 1.1 on pci1
em1: Ethernet address: 00:14:4f:20:4f:2d
em1: [FAST]

# ifconfig em1 && ifconfig em1 192.168.201.112 && sleep 5 && ifconfig em1
em1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        options=8b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWCSUM>
        ether 00:14:4f:20:4f:2d
        media: Ethernet autoselect (1000baseTX <full-duplex>)
        status: active
em1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=8b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWCSUM>
        inet 192.168.201.112 netmask 0xffffff00 broadcast 192.168.201.255
        ether 00:14:4f:20:4f:2d
        media: Ethernet autoselect (1000baseTX <full-duplex>)
        status: active


>How-To-Repeat:
Use revision 1.112 of if_em.c
>Fix:
Maybe that hardware initialisation was required after all?
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->glebius 
Responsible-Changed-By: maxim 
Responsible-Changed-When: Mon Feb 20 13:03:25 UTC 2006 
Responsible-Changed-Why:  
Over to the author of the code. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=93586 

From: Gleb Smirnoff <glebius@FreeBSD.org>
To: Chris Elsworth <chris@shagged.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/93586: [em] /src/sys/dev/em/if_em.c 1.112 breaks interfaces
Date: Mon, 20 Feb 2006 16:15:44 +0300

   Chris,
 
   what exact NIC do you have? Please show: pciconf -lv.
 
 -- 
 Totus tuus, Glebius.
 GLEBIUS-RIPN GLEB-RIPE

From: Chris Elsworth <chris@shagged.org>
To: Gleb Smirnoff <glebius@FreeBSD.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/93586: [em] /src/sys/dev/em/if_em.c 1.112 breaks interfaces
Date: Mon, 20 Feb 2006 14:43:35 +0000

 On Mon, Feb 20, 2006 at 04:15:44PM +0300, Gleb Smirnoff wrote:
 >   Chris,
 > 
 >   what exact NIC do you have? Please show: pciconf -lv.
 
 Hello Gleb,
 
 Thanks for the prompt followup!
 
 The NICs in this machine appear to be dual-port cards:
 em0@pci1:1:0:   class=0x020000 card=0x10118086 chip=0x10108086 rev=0x03 hdr=0x00
     vendor   = 'Intel Corporation'
     device   = '82546EB Dual Port Gigabit Ethernet Controller (Copper)'
     class    = network
     subclass = ethernet
 
 The full pciconf output can be found at
 http://spork.qfe3.net/~chris/4100_pciconf.txt
 
 -- 
 Chris

From: Chris Elsworth <chris@shagged.org>
To: Gleb Smirnoff <glebius@FreeBSD.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/93586: [em] /src/sys/dev/em/if_em.c 1.112 breaks interfaces
Date: Tue, 21 Feb 2006 16:21:37 +0000

 Hello,
 
 Just wanted to add that I see the same issue with revision 1.113 of
 if_em.c as well as 1.112 (didn't make that clear in previous posts).
 
 Adding em_hardware_init(sc) back in to if_em.c just after the bcopy()
 in em_init_locked() fixes the problem.
State-Changed-From-To: open->closed 
State-Changed-By: glebius 
State-Changed-When: Fri Mar 17 21:41:57 UTC 2006 
State-Changed-Why:  
Revision backed out. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=93586 
>Unformatted:
