From owner-freebsd-current@FreeBSD.ORG Fri Oct 3 08:29:54 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 786DC1A6; Fri, 3 Oct 2014 08:29:54 +0000 (UTC) Received: from mail-wg0-x22e.google.com (mail-wg0-x22e.google.com [IPv6:2a00:1450:400c:c00::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B368A9A5; Fri, 3 Oct 2014 08:29:53 +0000 (UTC) Received: by mail-wg0-f46.google.com with SMTP id l18so856947wgh.29 for ; Fri, 03 Oct 2014 01:29:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=mhfItokrNdFXIVIoyYsI+hEd0lTfOLqEv48PlOu6KBc=; b=1A/5ewotzL0wc6u6fnrIqSYPRLYXIsbS8jax/RQs5YWFWo8FYqFRdL1XLOTQHgGTal VwgsK+Kx2oKl0ltZ3CUOZ9EgjW4UESd0kU7U7HUoDyGGbwRnMiSwdpcCG6IQmMJ1gV6P de+BlnIAXjtPbRgPp5qkJjQo9tj0ZD5wQAG2QPmFIpvtpEVp9X0Gu6F8kBPTihIbfdqv M+48pP0CBzb3aV1dj01+iyYLgj22yLoMjG9jZeEcHQJbJIvNwjqXpopl3Wy10V+7ldei MvWsNn7ZrBGn7RpBp0SHnAprBEMmdeFQzbHXnTdfNnVGh4ICTuVK3ER6awvI6QWrlKVT ZD3w== MIME-Version: 1.0 X-Received: by 10.180.107.100 with SMTP id hb4mr10313043wib.59.1412324991891; Fri, 03 Oct 2014 01:29:51 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Fri, 3 Oct 2014 01:29:51 -0700 (PDT) In-Reply-To: <20141003081328.GZ73266@FreeBSD.org> References: <2113392.UOaBFTpimf@ralph.baldwin.cx> <201410021116.27583.jhb@freebsd.org> <20141003081328.GZ73266@FreeBSD.org> Date: Fri, 3 Oct 2014 01:29:51 -0700 X-Google-Sender-Auth: JwxfQgqeac_SvJazb2UIuXj7ObM Message-ID: Subject: Re: [PATCH] Fix OACTIVE for an(4) From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 Cc: 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:29:54 -0000 Having them as flags that can be seen from external is good for diagnostics. Having external things change behaviour (like queuing packets and running if_start) is error prone. It isn't a wrong concept. Computers just grew up a bit more. -a On 3 October 2014 01:13, Gleb Smirnoff wrote: > 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.