nat: preallocate pools 78/26378/5
authorKlement Sekera <ksekera@cisco.com>
Wed, 1 Apr 2020 18:58:15 +0000 (20:58 +0200)
committerKlement Sekera <ksekera@cisco.com>
Wed, 8 Apr 2020 09:07:49 +0000 (11:07 +0200)
Type: improvement

Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I1be559a98f74c28a9c83fe320c8ce02459793e66

src/plugins/nat/nat.c

index 2b5c428..5fc3eef 100755 (executable)
@@ -4073,6 +4073,9 @@ snat_config (vlib_main_t * vm, unformat_input_t * input)
               tsm->cleanup_runs = 0;
               tsm->cleanup_timeout = 0;
 
+              pool_alloc (tsm->sessions, sm->max_translations);
+              pool_alloc (tsm->list_pool, sm->max_translations);
+
               if (sm->endpoint_dependent)
                 {
                   clib_bihash_init_16_8 (&tsm->in2out_ed, "in2out-ed",