aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2020-06-11 10:35:52 +0000
committerKlement Sekera <ksekera@cisco.com>2020-06-11 10:37:11 +0000
commitcd35ed48d44615c49617e6d0135396b57cd43cd5 (patch)
treeb3a0f2f8a74a1510d8def608b161c25aa21171b9 /src
parenta1018c166a468f7692ab621c743503914266f508 (diff)
nat: properly scale out2in-ed hash on init
Type: fix Fixes: a1018c166a468f7692ab621c743503914266f508 Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: I86592f73a60fd146d3764e474f975881e940c244
Diffstat (limited to 'src')
-rw-r--r--src/plugins/nat/nat.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/nat/nat.c b/src/plugins/nat/nat.c
index 36d03a620d4..e4fed18371e 100644
--- a/src/plugins/nat/nat.c
+++ b/src/plugins/nat/nat.c
@@ -4122,8 +4122,10 @@ snat_config (vlib_main_t * vm, unformat_input_t * input)
nat_ha_init (vm, nat_ha_sadd_ed_cb, nat_ha_sdel_ed_cb,
nat_ha_sref_ed_cb);
clib_bihash_init_16_8 (&sm->out2in_ed, "out2in-ed",
+ clib_max (1, sm->num_workers) *
sm->translation_buckets,
- translation_memory_size);
+ clib_max (1, sm->num_workers) *
+ sm->translation_memory_size);
clib_bihash_set_kvp_format_fn_16_8 (&sm->out2in_ed,
format_ed_session_kvp);
}