summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2018-09-26 01:08:00 -0700
committerOle Trøan <otroan@employees.org>2018-09-26 12:45:40 +0000
commit37a3a2a08f72310a3f7e898a9b44af7751f2cc9c (patch)
treec481e87b741ee5ddaa332830d135ad1c46f39c1a /src
parentcefe1341c6a536ebe161d97ab6fb10db95e57d05 (diff)
NAT44: endpoint-dependent mode session timeout improvement (VPP-1423)
Change-Id: Ib62e503f4eb5d72431288de32f417a4553df4e0c Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/nat/in2out_ed.c14
-rw-r--r--src/plugins/nat/out2in_ed.c14
2 files changed, 28 insertions, 0 deletions
diff --git a/src/plugins/nat/in2out_ed.c b/src/plugins/nat/in2out_ed.c
index 31977acf2a3..adf0ff30948 100644
--- a/src/plugins/nat/in2out_ed.c
+++ b/src/plugins/nat/in2out_ed.c
@@ -242,6 +242,8 @@ icmp_in2out_ed_slow_path (snat_main_t * sm, vlib_buffer_t * b0,
nat44_session_update_counters (s0, now,
vlib_buffer_length_in_chain
(sm->vlib_main, b0));
+ /* Per-user LRU list maintenance */
+ nat44_session_update_lru (sm, s0, thread_index);
}
return next0;
}
@@ -473,6 +475,8 @@ nat_not_translate_output_feature_fwd (snat_main_t * sm, ip4_header_t * ip,
/* Accounting */
nat44_session_update_counters (s, now,
vlib_buffer_length_in_chain (vm, b));
+ /* Per-user LRU list maintenance */
+ nat44_session_update_lru (sm, s, thread_index);
return 1;
}
else
@@ -815,6 +819,8 @@ nat44_ed_in2out_unknown_proto (snat_main_t * sm,
/* Accounting */
nat44_session_update_counters (s, now, vlib_buffer_length_in_chain (vm, b));
+ /* Per-user LRU list maintenance */
+ nat44_session_update_lru (sm, s, thread_index);
/* Hairpinning */
if (vnet_buffer (b)->sw_if_index[VLIB_TX] == ~0)
@@ -1075,6 +1081,8 @@ nat44_ed_in2out_node_fn_inline (vlib_main_t * vm,
nat44_session_update_counters (s0, now,
vlib_buffer_length_in_chain (vm,
b0));
+ /* Per-user LRU list maintenance */
+ nat44_session_update_lru (sm, s0, thread_index);
trace00:
if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)
@@ -1274,6 +1282,8 @@ nat44_ed_in2out_node_fn_inline (vlib_main_t * vm,
nat44_session_update_counters (s1, now,
vlib_buffer_length_in_chain (vm,
b1));
+ /* Per-user LRU list maintenance */
+ nat44_session_update_lru (sm, s1, thread_index);
trace01:
if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)
@@ -1502,6 +1512,8 @@ nat44_ed_in2out_node_fn_inline (vlib_main_t * vm,
nat44_session_update_counters (s0, now,
vlib_buffer_length_in_chain (vm,
b0));
+ /* Per-user LRU list maintenance */
+ nat44_session_update_lru (sm, s0, thread_index);
trace0:
if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)
@@ -1927,6 +1939,8 @@ nat44_ed_in2out_reass_node_fn_inline (vlib_main_t * vm,
nat44_session_update_counters (s0, now,
vlib_buffer_length_in_chain (vm,
b0));
+ /* Per-user LRU list maintenance */
+ nat44_session_update_lru (sm, s0, thread_index);
trace0:
if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)
diff --git a/src/plugins/nat/out2in_ed.c b/src/plugins/nat/out2in_ed.c
index 1a9f8979c42..dce6c5616c5 100644
--- a/src/plugins/nat/out2in_ed.c
+++ b/src/plugins/nat/out2in_ed.c
@@ -112,6 +112,8 @@ icmp_out2in_ed_slow_path (snat_main_t * sm, vlib_buffer_t * b0,
nat44_session_update_counters (s0, now,
vlib_buffer_length_in_chain
(sm->vlib_main, b0));
+ /* Per-user LRU list maintenance */
+ nat44_session_update_lru (sm, s0, thread_index);
}
return next0;
}
@@ -453,6 +455,8 @@ create_bypass_for_fwd (snat_main_t * sm, ip4_header_t * ip, u32 rx_fib_index,
/* Accounting */
nat44_session_update_counters (s, now, 0);
+ /* Per-user LRU list maintenance */
+ nat44_session_update_lru (sm, s, thread_index);
}
u32
@@ -663,6 +667,8 @@ nat44_ed_out2in_unknown_proto (snat_main_t * sm,
/* Accounting */
nat44_session_update_counters (s, now, vlib_buffer_length_in_chain (vm, b));
+ /* Per-user LRU list maintenance */
+ nat44_session_update_lru (sm, s, thread_index);
return s;
}
@@ -936,6 +942,8 @@ nat44_ed_out2in_node_fn_inline (vlib_main_t * vm,
nat44_session_update_counters (s0, now,
vlib_buffer_length_in_chain (vm,
b0));
+ /* Per-user LRU list maintenance */
+ nat44_session_update_lru (sm, s0, thread_index);
trace00:
if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)
@@ -1152,6 +1160,8 @@ nat44_ed_out2in_node_fn_inline (vlib_main_t * vm,
nat44_session_update_counters (s1, now,
vlib_buffer_length_in_chain (vm,
b1));
+ /* Per-user LRU list maintenance */
+ nat44_session_update_lru (sm, s1, thread_index);
trace01:
if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)
@@ -1401,6 +1411,8 @@ nat44_ed_out2in_node_fn_inline (vlib_main_t * vm,
nat44_session_update_counters (s0, now,
vlib_buffer_length_in_chain (vm,
b0));
+ /* Per-user LRU list maintenance */
+ nat44_session_update_lru (sm, s0, thread_index);
trace0:
if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)
@@ -1769,6 +1781,8 @@ nat44_ed_out2in_reass_node_fn (vlib_main_t * vm,
nat44_session_update_counters (s0, now,
vlib_buffer_length_in_chain (vm,
b0));
+ /* Per-user LRU list maintenance */
+ nat44_session_update_lru (sm, s0, thread_index);
trace0:
if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)