diff options
author | Nathan Skrzypczak <nathan.skrzypczak@gmail.com> | 2021-06-04 18:37:27 +0200 |
---|---|---|
committer | Beno�t Ganne <bganne@cisco.com> | 2023-08-09 07:59:09 +0000 |
commit | 897844d1e96797f69e3e7e11d237d847fe4e46bf (patch) | |
tree | 5f6145b1bbe38fbd08bc438f05c6ee063615c358 /src/plugins/cnat/cnat_types.h | |
parent | 878a9f57061ec6313dc8ad8ef4f1eb55e32665e7 (diff) |
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 <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/plugins/cnat/cnat_types.h')
-rw-r--r-- | src/plugins/cnat/cnat_types.h | 10 |
1 files changed, 9 insertions, 1 deletions
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; |