From nobody@FreeBSD.org  Wed Apr 18 00:50:53 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 0A99116A404
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 18 Apr 2007 00:50:53 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id EED7213C4C8
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 18 Apr 2007 00:50:52 +0000 (UTC)
	(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 l3I0oqlc061368
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 18 Apr 2007 00:50:52 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l3I0jp25061046;
	Wed, 18 Apr 2007 00:45:51 GMT
	(envelope-from nobody)
Message-Id: <200704180045.l3I0jp25061046@www.freebsd.org>
Date: Wed, 18 Apr 2007 00:45:51 GMT
From: "Charles A. Newcomer"<charles@iapc.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: FreeBSD 6.X not transmitting outbound network traffic (BGE)
X-Send-Pr-Version: www-3.0

>Number:         111804
>Category:       kern
>Synopsis:       [bge] FreeBSD 6.X not transmitting outbound network traffic
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bz
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 18 01:00:08 GMT 2007
>Closed-Date:    Sat May 24 10:34:29 UTC 2008
>Last-Modified:  Sat May 24 10:34:29 UTC 2008
>Originator:     Charles A. Newcomer
>Release:        FreeBSD 6.2-RELEASE #0
>Organization:
IAPC
>Environment:
FreeBSD vox.stes.org 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 11:05:30 UTC 2007 root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386
>Description:
Compaq DL380 3.2 Dual Core Xeon using bge network driver (dual ports)
will not transmit network traffic until inbound traffic is received.
Does not populate arp cache until arp broadcast is *received* from
another device. 
>How-To-Repeat:
Assign external IP address to bge0.  Assign internal (192.168.X.X)
address to bge1.  Disable ip forwarding.

Place bge0 behind firewall and allow ssh port to be forwarded to bge0 address.

Boot system.
Log on to console.
Ping out.  Should receive no response.
ssh in.  now ping out.
ping should work.
>Fix:
None known.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: bz 
State-Changed-When: Mon Mar 17 09:46:00 UTC 2008 
State-Changed-Why:  
There is a patch, let's find out if it helps. 


Responsible-Changed-From-To: freebsd-bugs->bz 
Responsible-Changed-By: bz 
Responsible-Changed-When: Mon Mar 17 09:46:00 UTC 2008 
Responsible-Changed-Why:  
I am going to try to track this. 

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

From: "Bjoern A. Zeeb" <bz@FreeBSD.org>
To: bug-followup@FreeBSD.org, charles@iapc.net
Cc:  
Subject: Re: kern/111804: [bge] FreeBSD 6.X not transmitting outbound network
 traffic
Date: Mon, 17 Mar 2008 09:47:55 +0000 (UTC)

 Hi,
 
 Do you still see this problem?
 
 Can yout try this patch (might have offsets)?
 http://sources.zabbadoz.net/freebsd/patchset/20080317-01-dev-bge-linkup.diff
 
 
 Index: sys/dev/bge/if_bge.c
 ===================================================================
 RCS file: /shared/mirror/FreeBSD/r/ncvs/src/sys/dev/bge/if_bge.c,v
 retrieving revision 1.203
 diff -u -p -r1.203 if_bge.c
 --- sys/dev/bge/if_bge.c	6 Mar 2008 21:42:48 -0000	1.203
 +++ sys/dev/bge/if_bge.c	16 Mar 2008 23:17:44 -0000
 @@ -3793,6 +3807,7 @@ bge_ifmedia_upd_locked(struct ifnet *ifp
   			mii_phy_reset(miisc);
   	}
   	mii_mediachg(mii);
 +	BGE_SETBIT(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_SET);
 
   	return (0);
   }
 
 
 
 
 
 /bz
 
 -- 
 Bjoern A. Zeeb                                 bzeeb at Zabbadoz dot NeT
 Software is harder than hardware  so better get it right the first time.

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/111804: commit references a PR
Date: Tue,  8 Apr 2008 11:51:31 +0000 (UTC)

 bz          2008-04-08 11:51:17 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/dev/bge          if_bge.c 
   Log:
   In some situations we were not clearing pending link state attentions.
   Because of this we were not getting further interrupts for link state
   changes, thus never went into iface UP state and thus could not transmit.
   
   The only way out of this was an incoming packet generating an rx interrupt
   and making us call into bge_link_upd.
   
   Up to rev. 1.101, in bge_start_locked, we only returned instantly
   if there was 'no link AND nothing queued for tx'. So with a packet queued
   for tx, we hit the register scrubbing at the end of bge_start_locked
   and were out fine. We simply lost a packet or two but got the interrupts
   need to get into UP state.
   With rev. 1.102 this was turned into 'if there is no link OR there is
   nothing to send' (correct behaviour) and as long as there is no link
   we never hit the register scrubbing and consequently never got the link UP.
   
   What we do now is force an interrupt at the end of bge_ifmedia_upd_locked
   so we will call bge_link_upd, clear the link state attention and get
   further interrupts.
   This helps to get the iface UP on an idle network or at least to get
   it UP faster not depending on an rx intr anymore.
   In case you could not get a DHCP lease or it took very long,
   it was because of this.
   
   It is unknown which chips are affected by this. ASIC rev. 0x2003 was the
   most popular trouble candidate.
   At least the fiber cards should have been working fine.
   
   Which register to scrub is currently under discussion. The comitted
   solution was tested and found to work for a lot of setups. It might
   not help with MSI.
   The reason why we end up in such a situation is entirely unknown.
   
   PR:             kern/111804
   Tested by:      phk, scottl at Y!
   MFC after:      14 days
   
   Revision  Changes    Path
   1.205     +17 -0     src/sys/dev/bge/if_bge.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: feedback->patched 
State-Changed-By: bz 
State-Changed-When: Tue Apr 8 12:07:24 UTC 2008 
State-Changed-Why:  
if_bge.c rev. 1.205 has the workaround committed and will be MFCed. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/111804: commit references a PR
Date: Sat, 24 May 2008 10:23:42 +0000 (UTC)

 bz          2008-05-24 10:23:35 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_7)
     sys/dev/bge          if_bge.c if_bgereg.h 
   Log:
   MFC: if_bgereg.h rev. 1.79
        if_bge.c rev. 1.205, 1.209, 1.210
   
     Summary:
     In some situations we were not clearing pending link state attentions.
     Because of this we were not getting further interrupts for link state
     changes, thus never went into iface UP state and thus could not transmit.
   
     The only way out of this was an incoming packet generating an rx interrupt
     and making us call into bge_link_upd.
   
     What we do now is force an interrupt at the end of bge_ifmedia_upd_locked
     so we will call bge_link_upd, clear the link state attention and get
     further interrupts.
   
     While the initial version was not expected to work with all chips
     the later update in rev. 1.210 is.
   
   PR:                             kern/111804
   Tested by:                      phk, scottl (initial version)
   Thanks for your help to:        davidch, Broadcom
   
   Revision   Changes    Path
   1.198.2.7  +34 -2     src/sys/dev/bge/if_bge.c
   1.73.2.2   +4 -0      src/sys/dev/bge/if_bgereg.h
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: bz 
State-Changed-When: Sat May 24 10:33:46 UTC 2008 
State-Changed-Why:  
THe changes were MFCed. 

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