aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat44_handoff.c
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2019-10-10 09:46:06 +0000
committerOle Trøan <otroan@employees.org>2020-01-03 10:10:15 +0000
commitf126e746fc01c75bc99329d10ce9127b26b23814 (patch)
treefaf9f09a363add6e140f30e25187b330843b3d21 /src/plugins/nat/nat44_handoff.c
parent3535501b19aec95dfd32870c784f841f57b5c045 (diff)
nat: use SVR
Remove NAT's implementation of shallow virtual reassembly with corresponding CLIs, APIs & tests. Replace with standalone shallow virtual reassembly provided by ipX-sv-reass* nodes. Type: refactor Change-Id: I7e6c7487a5a500d591f6871474a359e0993e59b6 Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat44_handoff.c')
-rw-r--r--src/plugins/nat/nat44_handoff.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/plugins/nat/nat44_handoff.c b/src/plugins/nat/nat44_handoff.c
index 277f2de57fe..d221e5ba7cd 100644
--- a/src/plugins/nat/nat44_handoff.c
+++ b/src/plugins/nat/nat44_handoff.c
@@ -82,7 +82,6 @@ nat44_worker_handoff_fn_inline (vlib_main_t * vm,
vlib_buffer_t *bufs[VLIB_FRAME_SIZE], **b = bufs;
snat_main_t *sm = &snat_main;
- snat_get_worker_function_t *get_worker;
u32 fq_index, thread_index = vm->thread_index;
from = vlib_frame_vector_args (frame);
@@ -93,12 +92,10 @@ nat44_worker_handoff_fn_inline (vlib_main_t * vm,
if (is_in2out)
{
fq_index = is_output ? sm->fq_in2out_output_index : sm->fq_in2out_index;
- get_worker = sm->worker_in2out_cb;
}
else
{
fq_index = sm->fq_out2in_index;
- get_worker = sm->worker_out2in_cb;
}
while (n_left_from >= 4)
@@ -147,10 +144,20 @@ nat44_worker_handoff_fn_inline (vlib_main_t * vm,
rx_fib_index2 = ip4_fib_table_get_index_for_sw_if_index (sw_if_index2);
rx_fib_index3 = ip4_fib_table_get_index_for_sw_if_index (sw_if_index3);
- ti[0] = get_worker (ip0, rx_fib_index0, is_output);
- ti[1] = get_worker (ip1, rx_fib_index1, is_output);
- ti[2] = get_worker (ip2, rx_fib_index2, is_output);
- ti[3] = get_worker (ip3, rx_fib_index3, is_output);
+ if (is_in2out)
+ {
+ ti[0] = sm->worker_in2out_cb (ip0, rx_fib_index0, is_output);
+ ti[1] = sm->worker_in2out_cb (ip1, rx_fib_index1, is_output);
+ ti[2] = sm->worker_in2out_cb (ip2, rx_fib_index2, is_output);
+ ti[3] = sm->worker_in2out_cb (ip3, rx_fib_index3, is_output);
+ }
+ else
+ {
+ ti[0] = sm->worker_out2in_cb (b[0], ip0, rx_fib_index0, is_output);
+ ti[1] = sm->worker_out2in_cb (b[1], ip1, rx_fib_index1, is_output);
+ ti[2] = sm->worker_out2in_cb (b[2], ip2, rx_fib_index2, is_output);
+ ti[3] = sm->worker_out2in_cb (b[3], ip3, rx_fib_index3, is_output);
+ }
if (ti[0] == thread_index)
same_worker++;
@@ -194,7 +201,14 @@ nat44_worker_handoff_fn_inline (vlib_main_t * vm,
sw_if_index0 = vnet_buffer (b[0])->sw_if_index[VLIB_RX];
rx_fib_index0 = ip4_fib_table_get_index_for_sw_if_index (sw_if_index0);
- ti[0] = get_worker (ip0, rx_fib_index0, is_output);
+ if (is_in2out)
+ {
+ ti[0] = sm->worker_in2out_cb (ip0, rx_fib_index0, is_output);
+ }
+ else
+ {
+ ti[0] = sm->worker_out2in_cb (b[0], ip0, rx_fib_index0, is_output);
+ }
if (ti[0] == thread_index)
same_worker++;