sounds good..

can you send us a patch to look at?


On Wed, 6 Mar 2002, 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.
> 
> Would it be useful to modify the (*pr_input) function pointer
> in the struct ipprotosw to take a fourth argument (perhaps it
> should be cast to a "void *" to keep it generalized?) to pass
> the pre-looked-up struct inpcb * to TCP, if the lookup has
> already been done?
> 
> Profiling indicates that this is one of the most expensive
> calls in the code path, particularly when there are a lot
> of sockets open.  Increasing the hash table size only works
> so far; at "a lot", the number of connections makes the
> lookup expensive anyway (it's a linear traversal of the
> collision chain for the bucket).
> 
> Since there are reasons other than firewalling to do the
> lookup early, it seems that it would be useful to pass a
> pointer the a pointer that was non-NULL, if the lookup had
> already taken place.  For example, moving the ipflow to
> use an overlay structure for the inpcb would mean that a
> single lookup was used for fast forwarding, firewalling,
> and inpcb identification for tcpcb retrieval for TCP.
> 
> Note that I'm only talking about the packet input path here,
> at this time, so the firewall code isn't really generalizable
> (the inpcb is already known on output, except to the ip_fw
> code; it probably doesn't make sense to push knwledge of it
> into the ip_output path, at least without more thought).
> 
> 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.
> 
> -- Terry
> 
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-net" in the body of the message
> 


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to