nat: properly scale out2in-ed hash on init 96/27496/1
authorKlement Sekera <[email protected]>
Thu, 11 Jun 2020 10:35:52 +0000 (10:35 +0000)
committerKlement Sekera <[email protected]>
Thu, 11 Jun 2020 10:37:11 +0000 (10:37 +0000)
Type: fix
Fixes: a1018c166a468f7692ab621c743503914266f508
Signed-off-by: Klement Sekera <[email protected]>
Change-Id: I86592f73a60fd146d3764e474f975881e940c244

src/plugins/nat/nat.c

index 36d03a6..e4fed18 100644 (file)
@@ -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);
        }