Date: Thu, 7 Mar 2002 03:51:41 -0800 (PST) From: Julian Elischer <julian@elischer.org> To: Bill Fumerola <billf@mu.org> Cc: Terry Lambert <tlambert2@mindspring.com>, net@freebsd.org, hackers@freebsd.org Subject: Re: in_pcblookup_hash() called multiple times Message-ID: <Pine.BSF.4.21.0203070351020.41354-100000@InterJet.elischer.org> In-Reply-To: <20020307092848.GX803@elvis.mu.org>
next in thread | previous in thread | raw e-mail | index | archive | help
what would be even nicer is if ipfw found the cached entry and passed it back to ip_input so it didn't need to :-) On Thu, 7 Mar 2002, Bill Fumerola wrote: > On Wed, Mar 06, 2002 at 05:07:55PM -0800, Terry Lambert wrote: > > > There are redundant calls to the in_pcblookup_hash() in the > > ip_fw_chk() function called via (*ip_fw_chk_ptr)() in the > > ip_input path. > > in addition to what you're talking about, ipfw will repeat the hash > lookup for every rule it goes through that has a uid or gid keyword. > > http://people.freebsd.org/~billf/bsdcon2000/presentation/graphics/countudpfromanytoanyuidbillf.png > http://people.freebsd.org/~billf/bsdcon2000/presentation/graphics/counttcpfromanytoanyuidbillf.png > > 'old ipfw' = ipfw as of oct 2000 > 'new ipfw' = ipfw w/pcb cache + uid cache (as part of a compiled ruleset) > > in the compiled case, in_pcblookup_hash() is called the first time a uid > needs compared. after that, uid lookups become a integer compare and not > another call to in_pcblookup_hash(). gid lookups still use groupmember() > each rule, but also don't have to do a pcb lookup each time. > > > Right now, I'm just talking about a way ip_input could pass > > the already looked up input inpcb to tcp_input, udp_input, > > or udp_ctlinput -- all of which repeat the lookup operation. > > my results are with a cached lookup just in the ipfw code, but if > ip_input() did the lookup and passed it to both ipfw and the protocol > handler that would be nice. > > -- > - bill fumerola / fumerola@yahoo-inc.com / billf@FreeBSD.org / billf@mu.org > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0203070351020.41354-100000>