Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Mar 2020 14:08:48 +0100
From:      Marko Zec <zec@fer.hr>
To:        Lev Serebryakov <lev@FreeBSD.org>
Cc:        freebsd-net@freebsd.org
Subject:   Re: IPFW In-Kernel NAT vs PF NAT Performance
Message-ID:  <20200319140848.4160644c@x23>
In-Reply-To: <2ea463e1-a1ee-defe-b640-ad45f56a4949@FreeBSD.org>
References:  <fc638872b9bdf14c13e2d6c13e698d1e@neelc.org> <F154BCBA-4079-48CA-ACE9-F01FBCBD53D0@FreeBSD.org> <cb87cc92-59ff-119e-be43-41d51b94f7e9@FreeBSD.org> <55dbea1fe75777780be166756c7641e8@neelc.org> <2ea463e1-a1ee-defe-b640-ad45f56a4949@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 19 Mar 2020 14:33:34 +0300
Lev Serebryakov <lev@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200319140848.4160644c>