From owner-cvs-src@FreeBSD.ORG Wed Sep 21 19:03:14 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7D5AF16A41F; Wed, 21 Sep 2005 19:03:14 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (cell.sick.ru [217.72.144.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id C3B7E43D46; Wed, 21 Sep 2005 19:03:13 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.13.3/8.13.3) with ESMTP id j8LJ2oZW045522 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 21 Sep 2005 23:02:50 +0400 (MSD) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.sick.ru (8.13.3/8.13.1/Submit) id j8LJ2o12045521; Wed, 21 Sep 2005 23:02:50 +0400 (MSD) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.sick.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 21 Sep 2005 23:02:50 +0400 From: Gleb Smirnoff To: John Baldwin Message-ID: <20050921190250.GX36166@cell.sick.ru> References: <200509190310.j8J3ALgt095979@repoman.freebsd.org> <20050920223315.V34322@fledge.watson.org> <20050921154153.GB22964@ip.net.ua> <200509211455.59154.jhb@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <200509211455.59154.jhb@FreeBSD.org> User-Agent: Mutt/1.5.6i Cc: Robert Watson , Ruslan Ermilov , "M. Warner Losh" , cvs-src@FreeBSD.org Subject: cleanup of interface shutdown/detach Was: cvs commit: src/sys/dev/an X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2005 19:03:14 -0000 On Wed, Sep 21, 2005 at 02:55:57PM -0400, John Baldwin wrote: J> > 4. Remove IFF_DRV_RUNNING check from ether_output(). 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