IPFW In-Kernel NAT vs PF NAT Performance

Marko Zec zec at fer.hr
Thu Mar 19 13:08:04 UTC 2020


On Thu, 19 Mar 2020 14:33:34 +0300
Lev Serebryakov <lev at FreeBSD.org> wrote:

> On 19.03.2020 7:14, Neel Chauhan wrote:
> 
> > However, if you know, where in the code does libalias use only 4096
> > buckets? I want to know incase I want/have to switch back to IPFW.  
>  4096 is my mistake, it is 4001 and must be prime. It is here:
> 
> sys/netinet/libalias/alias_local.h:69-70:
> 
> #define LINK_TABLE_OUT_SIZE        4001
> #define LINK_TABLE_IN_SIZE         4001

Out of curiosity, why exactly _must_ the hash size be a prime here?
Doing a quick

fgrep -R powerof2 /sys/netinet | fgrep hash

reveals that a completely different line of thought prevails there, and
probably elsewhere as well?  What gives?

Marko


More information about the freebsd-net mailing list