diff options
author | Klement Sekera <ksekera@cisco.com> | 2020-05-04 09:56:58 +0000 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2020-05-13 11:39:30 +0000 |
commit | a3a830484fa6b6487f7f3d991a52cb6b090a8be8 (patch) | |
tree | 3b833401c46da712228b0c1194b9f6c3b80b0ffa /src/plugins/nat/nat44/inlines.h | |
parent | bc752e432ff3e252f6e1a3f0372c9532f14909cd (diff) |
nat: fix LRU blocked by inactive session
This fixes a situation where long-lived inactive session blocks LRU
list. Solution is to have multiple LRU lists based on session type.
This helps because session timeout is same for all sessions of same
type.
Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I5e54b2aab73b23911d6518d42e8c3f166c69a38c
Diffstat (limited to 'src/plugins/nat/nat44/inlines.h')
-rw-r--r-- | src/plugins/nat/nat44/inlines.h | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/plugins/nat/nat44/inlines.h b/src/plugins/nat/nat44/inlines.h index a5118ea2fa6..62121dfb0db 100644 --- a/src/plugins/nat/nat44/inlines.h +++ b/src/plugins/nat/nat44/inlines.h @@ -59,25 +59,12 @@ nat44_session_reuse_old (snat_main_t * sm, snat_user_t * u, s->ext_host_port = 0; s->ext_host_nat_addr.as_u32 = 0; s->ext_host_nat_port = 0; - s->tcp_close_timestamp = 0; + s->tcp_closed_timestamp = 0; s->ha_last_refreshed = now; return s; } static_always_inline void -nat44_global_lru_insert (snat_main_per_thread_data_t * tsm, - snat_session_t * s, f64 now) -{ - dlist_elt_t *lru_list_elt; - pool_get (tsm->global_lru_pool, lru_list_elt); - s->global_lru_index = lru_list_elt - tsm->global_lru_pool; - clib_dlist_addtail (tsm->global_lru_pool, tsm->global_lru_head_index, - s->global_lru_index); - lru_list_elt->value = s - tsm->sessions; - s->last_lru_update = now; -} - -static_always_inline void nat44_sessions_clear () { snat_main_t *sm = &snat_main; |