From owner-cvs-src@FreeBSD.ORG Thu Dec 21 14:24:48 2006 Return-Path: X-Original-To: cvs-src@freebsd.org Delivered-To: cvs-src@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DB9AA16A407; Thu, 21 Dec 2006 14:24:48 +0000 (UTC) (envelope-from bde@zeta.org.au) Received: from mailout1.pacific.net.au (mailout1-3.pacific.net.au [61.8.2.210]) by mx1.freebsd.org (Postfix) with ESMTP id 867F313C45F; Thu, 21 Dec 2006 14:24:48 +0000 (UTC) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout1.pacific.net.au (Postfix) with ESMTP id 300CD5A3FE0; Fri, 22 Dec 2006 01:24:47 +1100 (EST) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id 02D9E8C05; Fri, 22 Dec 2006 01:24:45 +1100 (EST) Date: Fri, 22 Dec 2006 01:24:45 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Gleb Smirnoff In-Reply-To: <20061220132631.GH34400@FreeBSD.org> Message-ID: <20061222003115.R16146@delplex.bde.org> References: <200612201203.kBKC3MhO053666@repoman.freebsd.org> <20061220132631.GH34400@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@freebsd.org, src-committers@freebsd.org, Bruce Evans , cvs-all@freebsd.org Subject: Re: 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: Thu, 21 Dec 2006 14:24:49 -0000 On Wed, 20 Dec 2006, Gleb Smirnoff wrote: > On Wed, Dec 20, 2006 at 12:03:21PM +0000, Bruce Evans wrote: > B> bde 2006-12-20 12:03:21 UTC > B> > B> FreeBSD src repository > B> > B> Modified files: > B> sys/dev/bge if_bge.c > B> Log: > B> In bge_txeof(), cancel the watchdog timeout if all descriptors have > B> been handled instead of when at least one descriptor was just handled. > B> For bge, it is normal to get a txeof when only a small fraction of the > B> queued tx descriptors have been handled, so the bug broke the watchdog > B> in a usual case. > > I have a suspicion that this may cause a problem under high load. Imagine > that thread #1 is spinning in bge_start_locked() getting packets out > of interface queue and putting them into TX ring. Some other threads are > putting the packets into interface queue while its lock is temporarily > relinguished be the thread #1. In the same time interrupts happen, some > packets are sent, but the TX ring is never got empty. > > The above scenario will cause a fake watchdog event. bge_start_locked() starts with the bge (sc) lock held and never releases it as far as I can see. This this problem can't happen (the lock prevents both txeof and the watchdog from being reached before start resets the timeout to 5 seconds). I could only find the lock being released and reacquired in a nested routine in bge_rxeof() (for calling if_input()). I hope this complication is never needed for start routines. Bruce