From owner-freebsd-current@FreeBSD.ORG Fri Oct 3 08:13:31 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 172E2A19; Fri, 3 Oct 2014 08:13:31 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DBF1846; Fri, 3 Oct 2014 08:13:30 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s938DSAd095942 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 3 Oct 2014 12:13:28 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s938DSRZ095941; Fri, 3 Oct 2014 12:13:28 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 3 Oct 2014 12:13:28 +0400 From: Gleb Smirnoff To: John Baldwin Subject: Re: [PATCH] Fix OACTIVE for an(4) Message-ID: <20141003081328.GZ73266@FreeBSD.org> References: <2113392.UOaBFTpimf@ralph.baldwin.cx> <201410021116.27583.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201410021116.27583.jhb@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Adrian Chadd , freebsd-current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Oct 2014 08:13:31 -0000 On Thu, Oct 02, 2014 at 11:16:27AM -0400, John Baldwin wrote: J> > I haven't looked at the rest of the driver; is everything else around J> > OACTIVE locked correctly and consistently? J> J> As well as OACTIVE is for any other driver. Let me jump into this topic and discuss the if_drv_flags :) It seems to me that this in general was a wrong concept, both IFF_DRV_OACTIVE and IFF_DRV_RUNNING. The internal state of the driver can be known only to the driver itself and should be stored in the softc, covered with internal lock. There is simply no way to racelessly tell the state from the outside, without obtaining driver lock. In my ifnet plans I am considering to remove if_drv_flags. Can anyone convince me that this is a wrong idea and they should be kept? -- Totus tuus, Glebius.