Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 May 2019 20:12:56 -0700
From:      Gleb Smirnoff <glebius@freebsd.org>
To:        "Andrey V. Elsukov" <bu7cher@yandex.ru>
Cc:        "Andrey V. Elsukov" <ae@freebsd.org>, kib@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r348303 - head/sys/net
Message-ID:  <20190529031256.GE21836@FreeBSD.org>
In-Reply-To: <a7694fb5-2353-fcc1-5bfe-04064fc5825c@yandex.ru>
References:  <201905271241.x4RCffTm047128@repo.freebsd.org> <20190529001046.GC21836@FreeBSD.org> <a7694fb5-2353-fcc1-5bfe-04064fc5825c@yandex.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, May 29, 2019 at 03:23:23AM +0300, Andrey V. Elsukov wrote:
A> > --- a/FreeBSD/sys/net/bpf.c
A> > +++ b/FreeBSD/sys/net/bpf.c
A> > @@ -857,7 +857,6 @@ bpf_detachd_locked(struct bpf_d *d, bool detached_ifp)
A> >         /* Save bd_writer value */
A> >         error = d->bd_writer;
A> >         ifp = bp->bif_ifp;
A> > -       d->bd_bif = NULL;
A> >         if (detached_ifp) {
A> >                 /*
A> >                  * Notify descriptor as it's detached, so that any
A> > 
A> > Since every bpf_d holds a reference on bpf_if until delayed free happens,
A> > the the bpf_if is going to be valid.
A> > 
A> > This allows not to use epoch_wait and run fully async. The patch above is
A> > a minimal patch: with NULL assignment removed, several more pieces of code
A> > can be removed in bpf.c
A> > 
A> > Of course your patch also is going to work, but what do you think:
A> > are there any landmines with fully async approach?
A> 
A> Hi,
A> 
A> bpf_mtap() is not the only consumer of bd_bif, some of them expect it
A> becomes NULL when descriptor is detached.

May be then make a flag attached/detached?

-- 
Gleb Smirnoff



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190529031256.GE21836>