From owner-freebsd-current@FreeBSD.ORG Tue Aug 29 22:04:16 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5DD4716A4DF for ; Tue, 29 Aug 2006 22:04:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A86C43D4C for ; Tue, 29 Aug 2006 22:04:15 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (zion.baldwin.cx [192.168.0.7]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k7TM47Mv010445; Tue, 29 Aug 2006 18:04:07 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-current@freebsd.org Date: Tue, 29 Aug 2006 18:04:03 -0400 User-Agent: KMail/1.9.1 References: <09BFF2FA5EAB4A45B6655E151BBDD90301E2EF85@NT-IRVA-0750.brcm.ad.broadcom.com> In-Reply-To: <09BFF2FA5EAB4A45B6655E151BBDD90301E2EF85@NT-IRVA-0750.brcm.ad.broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608291804.03848.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [192.168.0.1]); Tue, 29 Aug 2006 18:04:08 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/1761/Tue Aug 29 14:58:36 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: David Christensen , Sam Eaton Subject: Re: [sam@fqdn.net: bce0 watchdog timeout errors] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Aug 2006 22:04:16 -0000 On Tuesday 29 August 2006 17:33, David Christensen wrote: > > I see looking through the archives that Julian Elischer has reported > > something *vaguely* similar to my problems described in the attached > > message to this list, so I thought I'd join in. > > > > Julian reports a problem when the bce interface is > > disconnected and then > > reconnected under load, and never comes back until all load > > is removed, > > while reporting watchdog timeout errors. > > > > I see something rather like this (details in the attached message > > (hopefully the attachment will survive :))), but without physically > > disconnecting the cable. > > > > I am wondering if I'm actually seeing the same problem, but > > that rather > > than the cable being unplugged, it's something like the interface > > resetting on our (old, 100Mb/s) switch resetting and triggering this. > > > > Thought it was worth offering another data point. I'm > > running the most > > recent version of the bce driver with the changes to fix the 'mbuf' > > errors. > > > > A change was recently added to bge (r1.140) to address some issues > with locking in the driver when performing PHY accesses which was > also causing watchdog timeout errors. I need to look at those > changes and see if they are applicable to the bce driver as well, > though I've been having problems loading both bge and bce as > modules on -CURRENT (causes a panic). If I can get past the module > problem I'll look at the bge change soon. bce_ifmedia_sts() has locking, but bce_ifmedia_upd() is missing locking. Something like this would do it: Index: if_bce.c =================================================================== RCS file: /host/cvs/usr/cvs/src/sys/dev/bce/if_bce.c,v retrieving revision 1.7 diff -u -r1.7 if_bce.c --- if_bce.c 15 Aug 2006 04:56:29 -0000 1.7 +++ if_bce.c 29 Aug 2006 22:03:17 -0000 @@ -3933,15 +3933,17 @@ /* DRC - ToDo: Add SerDes support. */ + BCE_LOCK(sc); mii = device_get_softc(sc->bce_miibus); sc->bce_link = 0; if (mii->mii_instance) { struct mii_softc *miisc; - for (miisc = LIST_FIRST(&mii->mii_phys); miisc != NULL; - miisc = LIST_NEXT(miisc, mii_list)) + + LIST_FOREACH(miisc, &mii->mii_physm, mii_list) mii_phy_reset(miisc); } mii_mediachg(mii); + BCE_UNLOCK(sc); return(rc); } -- John Baldwin