From owner-freebsd-current@FreeBSD.ORG Tue Aug 22 04:20:48 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 5CEE916A4DE for ; Tue, 22 Aug 2006 04:20:48 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.180]) by mx1.FreeBSD.org (Postfix) with ESMTP id 19D0D43D67 for ; Tue, 22 Aug 2006 04:20:40 +0000 (GMT) (envelope-from pyunyh@gmail.com) Received: by py-out-1112.google.com with SMTP id o67so2686561pye for ; Mon, 21 Aug 2006 21:20:40 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:from:to:subject:message-id:reply-to:mime-version:content-type:content-disposition:user-agent; b=pDD5ji/+6OyqrjoURdZnSauWRqmpox1k/l9bFinLB+Bs5CnYg/XqGk7+q1WpaWPxePor8Mwve7rVMzwp6UFbB8MZc2VJ4qTV3dOAh4dlWTWBUd52Ryl7f7OLx98A0Qj4cZqgVd7ibnNXGTyGVLEwPSNrJ/DvFTn2jKrv+g2rQTs= Received: by 10.35.41.12 with SMTP id t12mr14692774pyj; Mon, 21 Aug 2006 21:20:40 -0700 (PDT) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.gmail.com with ESMTP id 17sm74932nzo.2006.08.21.21.20.39; Mon, 21 Aug 2006 21:20:40 -0700 (PDT) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.13.5/8.13.5) with ESMTP id k7M4KOSk014085 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 22 Aug 2006 13:20:24 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id k7M4KNYm014084 for freebsd-current@FreeBSD.org; Tue, 22 Aug 2006 13:20:23 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Tue, 22 Aug 2006 13:20:23 +0900 From: Pyun YongHyeon To: freebsd-current@FreeBSD.org Message-ID: <20060822042023.GC12848@cdnetworks.co.kr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Nq2Wo0NMKNjxTN9z" Content-Disposition: inline User-Agent: Mutt/1.4.2.1i Cc: Subject: call for bge(4) testers X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Aug 2006 04:20:48 -0000 --Nq2Wo0NMKNjxTN9z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, After fixing em(4) watchdog bug, I looked over bge(4) and I think bge(4) may suffer from the same issue. So if you have seen occasional watchdog timeout errors on bge(4) please give the attached patch a try. The patch does fix false watchdog timeout error only. Typical pheonoma for false watchdog timeout error are o polling(4) fix the issue o random watchdog error If my patch fix the issue you could see the following messages. "missing Tx completion interrupt!" or "link lost -- resetting" Thanks. -- Regards, Pyun YongHyeon --Nq2Wo0NMKNjxTN9z Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="bge.watchdog.patch" Index: if_bge.c =================================================================== RCS file: /pool/ncvs/src/sys/dev/bge/if_bge.c,v retrieving revision 1.138 diff -u -r1.138 if_bge.c --- if_bge.c 18 Aug 2006 13:53:53 -0000 1.138 +++ if_bge.c 22 Aug 2006 04:18:12 -0000 @@ -3452,12 +3452,29 @@ sc = ifp->if_softc; - if_printf(ifp, "watchdog timeout -- resetting\n"); + BGE_LOCK(sc); + /* + * Reclaim first as there is a possibility of losing Tx completion + * interrupts. Possible cause of missing Tx completion interrupts + * comes from Tx interrupt moderation mechanism(delayed interrupts) + * or chipset bug. + */ + bge_txeof(sc); + if (sc->bge_txcnt == 0) { + if_printf(ifp, "missing Tx completion interrupt!\n"); + BGE_UNLOCK(sc); + return; + } + if (sc->bge_link) + if_printf(ifp, "watchdog timeout -- resetting\n"); + else + if_printf(ifp, "link lost -- resetting\n"); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - bge_init(sc); + bge_init_locked(sc); ifp->if_oerrors++; + BGE_UNLOCK(sc); } /* --Nq2Wo0NMKNjxTN9z--