svn commit: r194763 - in head/sys: conf dev/gem modules/gem

John Baldwin jhb at freebsd.org
Tue Jun 23 21:59:39 UTC 2009


On Tuesday 23 June 2009 5:13:42 pm Marius Strobl wrote:
> On Tue, Jun 23, 2009 at 05:03:20PM -0400, John Baldwin wrote:
> > On Tuesday 23 June 2009 4:36:59 pm Marius Strobl wrote:
> > > Author: marius
> > > Date: Tue Jun 23 20:36:59 2009
> > > New Revision: 194763
> > > URL: http://svn.freebsd.org/changeset/base/194763
> > > 
> > > Log:
> > >   - Initialize the ifnet structure, especially if_dname, before probing
> > >     the PHYs as some PHY drivers use it (but probably shouldn't). How
> > >     gem(4) has worked with brgphy(4) on powerpc without this so far is
> > >     unclear to me.
> > >   - Introduce a dying flag which is set during detach and checked in
> > >     gem_ioctl() in order to prevent active BPF listeners to clear
> > >     promiscuous mode which may lead to the tick callout being restarted
> > >     which will trigger a panic once it's actually gone.
> > 
> > This should not be needed assuming you follow a model of:
> > 
> > gem_detach()
> > {
> > 
> > 	ether_ifdetach(ifp);	/* calls bpfdetach() */
> > 	GEM_LOCK(sc);
> > 	gem_stop(sc);
> > 	GEM_UNLOCK(sc);
> > 	...
> > }
> > 
> > If you are invoking gem_stop() prior to ether_ifdetach() then that is your 
> > real bug. :)
> > 
> 
> Okay, I'll let yongari@ comment on this as he was the one
> who claimed that either clearing IFF_UP in the driver before
> calling ether_ifdetach(9) (which I think is a layering
> violation) or the committed approach is necessary in order
> to solve the problem :)

I don't think one needs to clear IFF_UP explicitly.  if_detach() will 
if_down() the interface as parts of its internal teardown.

-- 
John Baldwin


More information about the svn-src-all mailing list