From owner-freebsd-net@FreeBSD.ORG Sat Mar 12 12:24:36 2005 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 741CD16A4CE; Sat, 12 Mar 2005 12:24:36 +0000 (GMT) Received: from cyrus.watson.org (cyrus.watson.org [204.156.12.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id EF20E43D53; Sat, 12 Mar 2005 12:24:35 +0000 (GMT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by cyrus.watson.org (Postfix) with SMTP id A319C46B6C; Sat, 12 Mar 2005 07:24:35 -0500 (EST) Date: Sat, 12 Mar 2005 12:22:09 +0000 (GMT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Pawel Jakub Dawidek In-Reply-To: <20050311213544.GH9291@darkness.comp.waw.pl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: dima <_pppp@mail.ru> cc: John Baldwin cc: Luigi Rizzo cc: Julian Elischer cc: net@freebsd.org Subject: Re: Giant-free polling [PATCH] 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: Sat, 12 Mar 2005 12:24:36 -0000 On Fri, 11 Mar 2005, Pawel Jakub Dawidek wrote: > On Fri, Mar 11, 2005 at 01:14:38PM -0800, Julian Elischer wrote: > +> >P> There is still an unresolved problem (in your and our patch as well) of > +> >P> using ifnet structure fields without synchronization, as we don't have > +> >P> access tointerface's internal mutex, which protects those fields. > +> > +> you need to add an interface method that has access to it.. > > I was thinking more about moving interface mutex into ifnet structure, > but Robert has some objections IIRC. My specific concern was to make sure that we don't lock device driver writers into a locking model that forces them to protect the device driver with a single mutex. There are changes floating around to protect the if_em receive and transmit components separately, since the're basically independent hardware units and can be accessed from multiple CPUs in parallel. This is also, I believe, what several Linux device drivers do. So I'm OK with a multi-layer mutex in ifnet protecting ifnet and device driver data, but only if we don't preclude the parallelism benefits that can be attained as suggested above. Robert N M Watson