From owner-cvs-all@FreeBSD.ORG Thu Sep 22 10:14:04 2005 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4DFC916A41F; Thu, 22 Sep 2005 10:14:04 +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 E3DC643D45; Thu, 22 Sep 2005 10:14:03 +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 4422246B9C; Thu, 22 Sep 2005 06:14:03 -0400 (EDT) Date: Thu, 22 Sep 2005 11:14:03 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: "M. Warner Losh" In-Reply-To: <20050921.134950.132929273.imp@bsdimp.com> Message-ID: <20050922111211.C34322@fledge.watson.org> References: <20050921191906.GA24516@ip.net.ua> <20050921.132322.116350250.imp@bsdimp.com> <20050921193410.GC24516@ip.net.ua> <20050921.134950.132929273.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@freebsd.org, src-committers@freebsd.org, ru@freebsd.org, cvs-all@freebsd.org, jhb@freebsd.org Subject: Re: cvs commit: src/sys/dev/an if_an.c src/sys/dev/arl if_arl_isa.c src/sys/dev/awi if_awi_pccard.c src/sys/dev/cm if_cm_isa.c src/sys/dev/cnw if_cnw.c src/sys/dev/cp if_cp.c src/sys/dev/cs if_cs.c src/sys/dev/ed if_ed.c src/sys/dev/em if_em.c ... X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2005 10:14:04 -0000 On Wed, 21 Sep 2005, M. Warner Losh wrote: > : The time you change say ifp->if_start in foo_detach(), stack may call > : it and get a half-changed pointer. Unless we invent locking shared > : between stack and the drivers. > > pointers can be changed atomically on all our platforms. The only race > is that there's a number of pointers that you need to change and you > can't change all of them at the same time. ifp->if_start will either > point to the old driver start routine, or it will point to the new > routine. It won't be 1/2 and 1/2. Well, you also have to be careful because, as with VOPs in VFS, device drivers often invoke ifp->if_whatever() during their normal running. Most frequently if_input(), which should be OK if done carefully, but we'd need to watch out for others. For example, do any device drivers call their own ioctl routines, start routines, etc, via the ifnet structure, or only directly via symbols? What about device drivers that plug into complex frameworks like 802.11? Robert N M Watson