aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/in2out_ed.c
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2020-04-05 10:22:47 +0200
committerKlement Sekera <ksekera@cisco.com>2020-04-08 11:07:49 +0200
commitba5f9bc7534bcf58225b0658993728b1f4d47a67 (patch)
treea3ca0cea8eea85910e050808c8df37bf802cd393 /src/plugins/nat/in2out_ed.c
parent248ce43c6d79b79597e28f19615e83d2bb0a9276 (diff)
nat: ED: global session LRU list
Maintain a global session LRU allowing reuse of expired session instead of relying on a scavenging mechanism to periodically walk sessions. Whenever a new session is being allocated in slow path, also attempt to free an expired session from global LRU list. Type: improvement Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: I9edde9ec138de67c9a4888e915b0490ec16415fa
Diffstat (limited to 'src/plugins/nat/in2out_ed.c')
-rw-r--r--src/plugins/nat/in2out_ed.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/plugins/nat/in2out_ed.c b/src/plugins/nat/in2out_ed.c
index 0ca1dd89ca8..807a716e942 100644
--- a/src/plugins/nat/in2out_ed.c
+++ b/src/plugins/nat/in2out_ed.c
@@ -951,7 +951,6 @@ nat44_ed_in2out_fast_path_node_fn_inline (vlib_main_t * vm,
snat_main_per_thread_data_t *tsm = &sm->per_thread_data[thread_index];
u32 tcp_packets = 0, udp_packets = 0, icmp_packets = 0, other_packets =
0, def_slow;
- u32 tcp_closed_drops = 0;
def_slow = is_output_feature ? NAT_NEXT_IN2OUT_ED_OUTPUT_SLOW_PATH :
NAT_NEXT_IN2OUT_ED_SLOW_PATH;
@@ -1065,7 +1064,6 @@ nat44_ed_in2out_fast_path_node_fn_inline (vlib_main_t * vm,
else
{
// session in transitory timeout, drop
- ++tcp_closed_drops;
b0->error = node->errors[NAT_IN2OUT_ED_ERROR_TCP_CLOSED];
next0 = NAT_NEXT_DROP;
}
@@ -1078,11 +1076,9 @@ nat44_ed_in2out_fast_path_node_fn_inline (vlib_main_t * vm,
(f64) nat44_session_get_timeout (sm, s0);
if (now >= sess_timeout_time)
{
- // delete session
nat_free_session_data (sm, s0, thread_index, 0);
nat44_delete_session (sm, s0, thread_index);
-
- // session no longer exists, go slow path
+ // session is closed, go slow path
next0 = def_slow;
goto trace0;
}