From owner-cvs-src@FreeBSD.ORG Tue Apr 8 11:51:17 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E76291065672; Tue, 8 Apr 2008 11:51:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id D74C78FC18; Tue, 8 Apr 2008 11:51:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m38BpH7S085891; Tue, 8 Apr 2008 11:51:17 GMT (envelope-from bz@repoman.freebsd.org) Received: (from bz@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m38BpHuL085890; Tue, 8 Apr 2008 11:51:17 GMT (envelope-from bz) Message-Id: <200804081151.m38BpHuL085890@repoman.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 8 Apr 2008 11:51:17 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/dev/bge if_bge.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2008 11:51:18 -0000 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