Date: Thu, 22 Sep 2005 11:14:03 +0100 (BST) From: Robert Watson <rwatson@FreeBSD.org> To: "M. Warner Losh" <imp@bsdimp.com> 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 ... Message-ID: <20050922111211.C34322@fledge.watson.org> In-Reply-To: <20050921.134950.132929273.imp@bsdimp.com> References: <20050921191906.GA24516@ip.net.ua> <20050921.132322.116350250.imp@bsdimp.com> <20050921193410.GC24516@ip.net.ua> <20050921.134950.132929273.imp@bsdimp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050922111211.C34322>