[FreeBSD-6.1Release]About the removal of route cache in PCB

Andre Oppermann andre at freebsd.org
Thu Jul 27 08:11:38 UTC 2006


Blue wrote:
> Hi, all:
> 
> I am wondering why the FreeBSD-6.1 version removes the route cache in 
> PCB (struct inpcbin in_pcb.h)? Does the removal do anything good? Or its 
> existence would have potential problems? 'Cause in my opinion, the 
> removal would only produce extra time when emitting a packet since the 
> routing table lookup is unavoidable. So there's must be a good reason 
> for the change.

The routing table pointer was complicating the SMP locking of the kernel
and had some other drawbacks.  With the pointer route changes would not
be picked up immediately but only when packets got lost and caused ICMP
responses.  And for that many full PCB table walks had to be done.
Simplicity was chosen and the route pointer was removed.  The tradeoff
isn't really bad as for most hosts the routing table is really small
containing only the default route and some ARP entries.  A lookup there
is pretty much always a cache only operation.  Only the locking overhead
for the routing table lookup adds in but we would have to do much of it
anyway to increment the refcount on the rtentry to send the packet.  On
servers with many connections the routing table could get quite large
because of all these cloned routes and consume valuable kernel memory.
No more routes for PCB's are cloned after the change.

-- 
Andre



More information about the freebsd-net mailing list