Subject: Re: ipsec pcb/socket passing
To: None <itojun@iijlab.net>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-net
Date: 08/25/2003 16:12:25
On Tue, 26 Aug 2003 itojun@iijlab.net wrote:

> >> 	the pointer dereference is really a concern, you can keep so-to-family
> >> 	mapping table cache.
> >
> >Ok. Why not just include said cache in the in{,6}pcb? Having multiple
> >caches doing the same thing doesn't seem like a good idea. Assuming I'm
> >understanding your suggestion right.
>
> 	my instinct (or usual rule) says that it is bad to hold the same
> 	information in multiple locations, as it is easy to for those to go
> 	inconsistent and have bad sideeffects, so i prefer to reference
> 	so->so_proto->pr_domain->dom_family for address family.

I understand that policy, and I respect it. Usually, I follow it also.

But we're talking about part of the kernel that has a huge impact on
network throughput. It really needs to be lean and mean. While what you're
describing is fine for IA-32 and moderately-heavy loads, if we push the
envelope, either with lots of connections or with lighter (embedded)
hardware, we'll be hurting ourselves.

What parts along the so->so_proto->pr_domain->dom_family chain will change
during a socket's lifetime? I think the best thing to do is comment "If
you change this, you need to change the in{,6}pcb."

Take care,

Bill