From owner-cvs-src@FreeBSD.ORG Thu Jul 14 14:45:56 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0674B16A41C; Thu, 14 Jul 2005 14:45:56 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [204.156.12.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id B1D7143D48; Thu, 14 Jul 2005 14:45:55 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by cyrus.watson.org (Postfix) with ESMTP id 5E2E846BB7; Thu, 14 Jul 2005 10:45:55 -0400 (EDT) Date: Thu, 14 Jul 2005 15:46:05 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Andrew Gallatin In-Reply-To: <20050714083608.A21239@grasshopper.cs.duke.edu> Message-ID: <20050714154334.P34679@fledge.watson.org> References: <200507131406.j6DE6DLv066313@repoman.freebsd.org> <20050714083608.A21239@grasshopper.cs.duke.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@FreeBSD.org, Gleb Smirnoff , cvs-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/pci if_xl.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, 14 Jul 2005 14:45:56 -0000 On Thu, 14 Jul 2005, Andrew Gallatin wrote: > Gleb Smirnoff [glebius@FreeBSD.org] wrote: >> glebius 2005-07-13 14:06:13 UTC >> >> FreeBSD src repository >> >> Modified files: >> sys/pci if_xl.c >> Log: >> NET_LOCK_GIANT() when entering network code. > > Do other drivers do this? It looks like at least em, fxp and my > out-of-tree commercial driver have the same "bug". > > I would argue that any fiddling with Giant should go into the various > if_input routines instead. This only applies in cases debug.mpsafenet=0, and where Giant isn't already held by virtue of the calling context. For most network interface, almost all entry "into" the stack occurs from the device's interrupt handler, and we already twiddle the aquisition of Giant there via INTR_TYPE_NET / INTR_MPSAFE. Because this occurs from a task queue, the driver has to manually acquire Giant, since the task queue code doesn't know that the driver requires Giant (due to entering the network stack in compatibility mode). Hopefully, NET_LOCK_GIANT() will be an increasingly edge case, as relatively few network stack components still require Giant. It exists only to support debug.mpsafenet=0, which is no longer the default. Robert N M Watson