Date: Thu, 5 Aug 2004 15:31:01 -0400 From: Brian Fundakowski Feldman <green@FreeBSD.org> To: Robert Watson <rwatson@FreeBSD.org> Cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/net bpf.c Message-ID: <20040805193101.GA89692@green.homeunix.org> In-Reply-To: <Pine.NEB.3.96L.1040804232326.19039G-100000@fledge.watson.org> References: <20040805030244.GB58239@green.homeunix.org> <Pine.NEB.3.96L.1040804232326.19039G-100000@fledge.watson.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Aug 04, 2004 at 11:23:49PM -0400, Robert Watson wrote: > > On Wed, 4 Aug 2004, Brian Fundakowski Feldman wrote: > > > On Thu, Aug 05, 2004 at 02:37:36AM +0000, Robert Watson wrote: > > > rwatson 2004-08-05 02:37:36 UTC > > > > > > FreeBSD src repository > > > > > > Modified files: > > > sys/net bpf.c > > > Log: > > > Do a lockless read of the BPF interface structure descriptor list head > > > before grabbing BPF locks to see if there are any entries in order to > > > avoid the cost of locking if there aren't any. Avoids a mutex lock/ > > > unlock for each packet received if there are no BPF listeners. > > > > While you're there, do you want to check out the other problems I've > > been noticing, relating to consistency/locking? > > Yes. Can you e-mail me the pointer to your patch and/or p4 branch again? > I'll try to look at it tomorrow. > > Thanks! The main problems are accesses to bpf_d->bd_bif; in bpf_detachd(), the accesses have no protection. I found that in catchpacket(), d->bd_bif could be NULL (crash). -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040805193101.GA89692>