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 _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"