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.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/plugins/cnat/cnat_types.c') 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)) -- cgit 1.2.3-korg