Date: Fri, 3 Oct 2014 01:29:51 -0700 From: Adrian Chadd <adrian@freebsd.org> To: Gleb Smirnoff <glebius@freebsd.org> Cc: freebsd-current <freebsd-current@freebsd.org> Subject: Re: [PATCH] Fix OACTIVE for an(4) Message-ID: <CAJ-Vmon40WNONOG9OSUBE63Gn2cQ1=v-UFpaRko58vrsu0odPA@mail.gmail.com> In-Reply-To: <20141003081328.GZ73266@FreeBSD.org> References: <2113392.UOaBFTpimf@ralph.baldwin.cx> <CAJ-VmomwiRRfHAGMn6onqQMXBEze40Nmyqya-5v8wMgZFC7iBg@mail.gmail.com> <201410021116.27583.jhb@freebsd.org> <20141003081328.GZ73266@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <glebius@freebsd.org> 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmon40WNONOG9OSUBE63Gn2cQ1=v-UFpaRko58vrsu0odPA>