From owner-freebsd-arch@FreeBSD.ORG Mon Jul 31 09:53:51 2006 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A4AAA16A4DE; Mon, 31 Jul 2006 09:53:51 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4E48B43D45; Mon, 31 Jul 2006 09:53:51 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 2B16A46B0F; Mon, 31 Jul 2006 05:53:39 -0400 (EDT) Date: Mon, 31 Jul 2006 10:53:39 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Hans Petter Selasky In-Reply-To: <200607311024.50537.hselasky@c2i.net> Message-ID: <20060731105045.X16341@fledge.watson.org> References: <20060730141642.D16341@fledge.watson.org> <44CCFC2C.20402@errno.com> <20060730200929.J16341@fledge.watson.org> <200607311024.50537.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: arch@freebsd.org, net@freebsd.org, freebsd-arch@freebsd.org Subject: Re: Changes in the network interface queueing handoff model X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2006 09:53:51 -0000 On Mon, 31 Jul 2006, Hans Petter Selasky wrote: > On Sunday 30 July 2006 21:23, Robert Watson wrote: >> On Sun, 30 Jul 2006, Sam Leffler wrote: > > Just a comment while the iron is hot: > > Maybe you can make the network model safe against detach. Currently I see > that the processor can be stuck in routines like "if_start" after that > "if_free()" has been called. This can be critical for USB ethernet devices. This is something to fix in the short or long term, but I think we should not try to fix everything at once as there is an awful lot to fix. There are really two stages to fixing the ifnet life cycle, which Brooks has been working on for some time. The first is to make it generally make sense -- he moved ifnet out of the softc, has been working to normalize things generally, (add dead ifnets), etc. The second is to add new types of reference and tear-down magic. What Solaris does here, FYI, is basically add a lock around entering the device driver via their mac layer in order to prevent it from "disappearing" while in use via the ifnet interface. I'm not sure if we want the same solution there or not, but it's worth thinking carefully about. We had (and have) similar problems in a number of other places, where races between consumers of an API and a detach of the provider cause problems. Robert N M Watson Computer Laboratory University of Cambridge