From owner-freebsd-net@FreeBSD.ORG Thu May 22 11:42:00 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 769B737B401 for ; Thu, 22 May 2003 11:42:00 -0700 (PDT) Received: from sccrmhc02.attbi.com (sccrmhc02.attbi.com [204.127.202.62]) by mx1.FreeBSD.org (Postfix) with ESMTP id BE68143FAF for ; Thu, 22 May 2003 11:41:59 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org (12-232-168-4.client.attbi.com[12.232.168.4]) by attbi.com (sccrmhc02) with ESMTP id <20030522184158002002khjqe>; Thu, 22 May 2003 18:41:58 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id LAA83110; Thu, 22 May 2003 11:41:57 -0700 (PDT) Date: Thu, 22 May 2003 11:41:54 -0700 (PDT) From: Julian Elischer To: Dave Dolson In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-net@freebsd.org Subject: RE: netgraph: why does ng_ether bother enqueuing packets? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2003 18:42:00 -0000 On Thu, 22 May 2003, Dave Dolson wrote: > > Julian Elischer wrote: > > On Wed, 21 May 2003, Vincent Jardin wrote: > > > > > Le Mercredi 21 Mai 2003 23:03, Dave Dolson a =E9crit : > > > > For reasons of performance, I tried the following modification to > > > > ng_ether.c in FreeBSD 4.7, and it seemed to work fine. > > > > The change is to call ng_send_data() vs. ng_queue_data(). > > > > The change is ok as long as you know that you are at splnet. > > I was trying to understand why it would be wrong to call ng_send_data from > an interrupt running at splimp(). > > Is this the correct explanation: > The netgraph (and most of net) code protects its data structures at splnet() > under the assumption that no routine capable of interrupting it will affect > those data structures. And the ether device interrupt routine can interrupt > code at splnet(). yes. it upgrades itself to splimp at crucial points (i.e. when passing data to the driver or dequeueing data from the queue) > > BTW, in FreeBSD how does one determine the spl level at which a device's > interrupt routines execute? > When you declare the interrupt driver that information is a part of the declaration (either if you folllow the pointers). > > Thanks for the feedback, > David Dolson (ddolson@sandvine.com, www.sandvine.com) > >