From 897844d1e96797f69e3e7e11d237d847fe4e46bf Mon Sep 17 00:00:00 2001 From: Nathan Skrzypczak Date: Fri, 4 Jun 2021 18:37:27 +0200 Subject: cnat: add ip/client bihash This replace the cnat ip4/ip6 to client lookups previously done with a regular hash, by a bihash lookup. Type: improvement Do the client lookup in a bihash instead of a hash. Change-Id: I730c1893525c002b44ada8e290a36802835e88e9 Signed-off-by: Nathan Skrzypczak --- src/plugins/cnat/cnat_types.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/plugins/cnat/cnat_types.h') diff --git a/src/plugins/cnat/cnat_types.h b/src/plugins/cnat/cnat_types.h index 84fb7d0b3c3..abae83af59a 100644 --- a/src/plugins/cnat/cnat_types.h +++ b/src/plugins/cnat/cnat_types.h @@ -36,12 +36,14 @@ #define CNAT_DEFAULT_SESSION_BUCKETS 1024 #define CNAT_DEFAULT_TRANSLATION_BUCKETS 1024 +#define CNAT_DEFAULT_CLIENT_BUCKETS 1024 #define CNAT_DEFAULT_SNAT_BUCKETS 1024 #define CNAT_DEFAULT_SNAT_IF_MAP_LEN 4096 #define CNAT_DEFAULT_SESSION_MEMORY (1 << 20) #define CNAT_DEFAULT_TRANSLATION_MEMORY (256 << 10) -#define CNAT_DEFAULT_SNAT_MEMORY (64 << 20) +#define CNAT_DEFAULT_CLIENT_MEMORY (256 << 10) +#define CNAT_DEFAULT_SNAT_MEMORY (64 << 10) /* Should be prime >~ 100 * numBackends */ #define CNAT_DEFAULT_MAGLEV_LEN 1009 @@ -120,6 +122,12 @@ typedef struct cnat_main_ /* Number of buckets of the translation bihash */ u32 translation_hash_buckets; + /* Memory size of the client bihash */ + uword client_hash_memory; + + /* Number of buckets of the client bihash */ + u32 client_hash_buckets; + /* Memory size of the source NAT prefix bihash */ uword snat_hash_memory; -- cgit 1.2.3-korg