aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cnat/cnat_types.c
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2021-06-04 18:37:27 +0200
committerBeno�t Ganne <bganne@cisco.com>2023-08-09 07:59:09 +0000
commit897844d1e96797f69e3e7e11d237d847fe4e46bf (patch)
tree5f6145b1bbe38fbd08bc438f05c6ee063615c358 /src/plugins/cnat/cnat_types.c
parent878a9f57061ec6313dc8ad8ef4f1eb55e32665e7 (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.c')
-rw-r--r--src/plugins/cnat/cnat_types.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/cnat/cnat_types.c b/src/plugins/cnat/cnat_types.c
index 9b164c6069d..b09459d8a14 100644
--- a/src/plugins/cnat/cnat_types.c
+++ b/src/plugins/cnat/cnat_types.c
@@ -191,6 +191,8 @@ cnat_config (vlib_main_t * vm, unformat_input_t * input)
cm->session_hash_buckets = CNAT_DEFAULT_SESSION_BUCKETS;
cm->translation_hash_memory = CNAT_DEFAULT_TRANSLATION_MEMORY;
cm->translation_hash_buckets = CNAT_DEFAULT_TRANSLATION_BUCKETS;
+ cm->client_hash_memory = CNAT_DEFAULT_CLIENT_MEMORY;
+ cm->client_hash_buckets = CNAT_DEFAULT_CLIENT_BUCKETS;
cm->snat_hash_memory = CNAT_DEFAULT_SNAT_MEMORY;
cm->snat_hash_buckets = CNAT_DEFAULT_SNAT_BUCKETS;
cm->snat_if_map_length = CNAT_DEFAULT_SNAT_IF_MAP_LEN;
@@ -215,6 +217,12 @@ cnat_config (vlib_main_t * vm, unformat_input_t * input)
else if (unformat (input, "translation-db-memory %U",
unformat_memory_size, &cm->translation_hash_memory))
;
+ else if (unformat (input, "client-db-buckets %u",
+ &cm->client_hash_buckets))
+ ;
+ else if (unformat (input, "client-db-memory %U", unformat_memory_size,
+ &cm->client_hash_memory))
+ ;
else if (unformat (input, "snat-db-buckets %u", &cm->snat_hash_buckets))
;
else if (unformat (input, "snat-if-map-len %u", &cm->snat_if_map_length))