diff options
author | Klement Sekera <ksekera@cisco.com> | 2020-04-01 20:58:15 +0200 |
---|---|---|
committer | Klement Sekera <ksekera@cisco.com> | 2020-04-08 11:07:49 +0200 |
commit | 248ce43c6d79b79597e28f19615e83d2bb0a9276 (patch) | |
tree | 4e585a203ea13c1050c595951515569735e08919 | |
parent | 6e8e10f79f8543ee60b5474932cda492abe48990 (diff) |
nat: preallocate pools
Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I1be559a98f74c28a9c83fe320c8ce02459793e66
-rwxr-xr-x | src/plugins/nat/nat.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/nat/nat.c b/src/plugins/nat/nat.c index 2b5c428ebc9..5fc3eefe106 100755 --- a/src/plugins/nat/nat.c +++ b/src/plugins/nat/nat.c @@ -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", |