Date: Wed, 21 Sep 2005 23:02:50 +0400 From: Gleb Smirnoff <glebius@FreeBSD.org> To: John Baldwin <jhb@FreeBSD.org> Cc: Robert Watson <rwatson@FreeBSD.org>, Ruslan Ermilov <ru@FreeBSD.org>, "M. Warner Losh" <imp@bsdimp.com>, cvs-src@FreeBSD.org Subject: cleanup of interface shutdown/detach Was: cvs commit: src/sys/dev/an Message-ID: <20050921190250.GX36166@cell.sick.ru> In-Reply-To: <200509211455.59154.jhb@FreeBSD.org> References: <200509190310.j8J3ALgt095979@repoman.freebsd.org> <20050920223315.V34322@fledge.watson.org> <20050921154153.GB22964@ip.net.ua> <200509211455.59154.jhb@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Sep 21, 2005 at 02:55:57PM -0400, John Baldwin wrote: J> > 4. Remove IFF_DRV_RUNNING check from ether_output(). <skip> J> I think you can leave #4 in if the race doesn't hurt anything. This check confuses people, is incorrect and useless. It confuses people, because they think that the !IFF_DRV_RUNNING condition is checked. It is incorrect because upper layer must not touch/look at if_drv_flags. It is useless because the flag is checked without driver mutex being acquired, and thus does not protect from anything. Yesterday I have fixed panic in em(4) that was "protected" by this check. The correct way is to check the flag in interface start method, with driver mutex held. -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050921190250.GX36166>