From owner-freebsd-net@FreeBSD.ORG Sun Mar 18 00:28:04 2007 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 971CD16A401 for ; Sun, 18 Mar 2007 00:28:04 +0000 (UTC) (envelope-from kip.macy@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.229]) by mx1.freebsd.org (Postfix) with ESMTP id 54C1813C45A for ; Sun, 18 Mar 2007 00:28:04 +0000 (UTC) (envelope-from kip.macy@gmail.com) Received: by wx-out-0506.google.com with SMTP id s18so874411wxc for ; Sat, 17 Mar 2007 17:28:03 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=R4hrNtM2knCUtbdbd8PH8VvuZN9mMPFOGn7fZDfewZegAy92/la/FEjoVYFySp9TdcsaxflrONDpErrd7QrjymKjqUXkAiFdXP84HYgR+9DeCrFU4c4qg6YLcA/4w+78T/J9OWuIXJKnlP2PgFs1SLcIaPzzP63UpqGydKNz/tw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Xm7aQkq07O8QlsBqdPN13fwPjSrZ3Kj89lZzNEZKpqaNMJUTbYoxdyvAPF7zaCHIF+Y1HZ1cd50AeYJl6qbBv/KFi7Ql9UQBil8ow28lLsuJUQ8nUb/+l/xfM3OKhMXR5mW01WlEGnGw0JOW1JzO2gagKF0urePUynJd+RJJMjM= Received: by 10.90.33.16 with SMTP id g16mr3025708agg.1174177683727; Sat, 17 Mar 2007 17:28:03 -0700 (PDT) Received: by 10.90.25.1 with HTTP; Sat, 17 Mar 2007 17:28:03 -0700 (PDT) Message-ID: Date: Sat, 17 Mar 2007 17:28:03 -0700 From: "Kip Macy" To: "Robert Watson" In-Reply-To: <20070316141836.J60288@fledge.watson.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <45FA98DD.3080205@cs.rutgers.edu> <20070316141836.J60288@fledge.watson.org> Cc: freebsd-net@freebsd.org, Aniruddha Bohra Subject: Re: ether_input question X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2007 00:28:04 -0000 > The reason the drivers drop their locks is > that the network stack frequently holds locks over calls to driver output > routines. As a result, driver locks tend to follow network stack locks in the > lock order--at least, for drivers that have a single lock covering both send > and receive paths (quite common). As a result, the driver must drop the > driver lock before calling into the stack to avoid a lock order reversal. Just to further clarify the corollary to this statement - drivers that separately lock their softc, tx, and rx queues don't need to drop the lock across if_input as there is no possibility of lock order reversal between the input and the output path. -Kip