From owner-svn-src-all@freebsd.org Wed May 29 03:12:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8C3615B470E; Wed, 29 May 2019 03:12:59 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 506D0768C2; Wed, 29 May 2019 03:12:58 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id x4T3Cuno024182 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 28 May 2019 20:12:56 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id x4T3CuaK024181; Tue, 28 May 2019 20:12:56 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Tue, 28 May 2019 20:12:56 -0700 From: Gleb Smirnoff To: "Andrey V. Elsukov" Cc: "Andrey V. Elsukov" , 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> References: <201905271241.x4RCffTm047128@repo.freebsd.org> <20190529001046.GC21836@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 506D0768C2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.930,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 03:13:00 -0000 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