From 3a5bd85476311d4ad2b0cbbca3f98d53f13a3afb Mon Sep 17 00:00:00 2001 From: Klement Sekera Date: Mon, 15 Mar 2021 19:52:57 +0100 Subject: nat: get rid of worker selection callbacks Make code easier to read and debug. Type: improvement Signed-off-by: Klement Sekera Change-Id: Ib52a4cdd3bcdcc475053aa32af3964c00859e1cd --- src/plugins/nat/nat44-ed/nat44_ed_handoff.c | 30 +++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'src/plugins/nat/nat44-ed/nat44_ed_handoff.c') diff --git a/src/plugins/nat/nat44-ed/nat44_ed_handoff.c b/src/plugins/nat/nat44-ed/nat44_ed_handoff.c index e286df93a6e..597a08c77b4 100644 --- a/src/plugins/nat/nat44-ed/nat44_ed_handoff.c +++ b/src/plugins/nat/nat44-ed/nat44_ed_handoff.c @@ -157,17 +157,25 @@ nat44_worker_handoff_fn_inline (vlib_main_t * vm, if (is_in2out) { - ti[0] = sm->worker_in2out_cb (b[0], ip0, rx_fib_index0, is_output); - ti[1] = sm->worker_in2out_cb (b[1], ip1, rx_fib_index1, is_output); - ti[2] = sm->worker_in2out_cb (b[2], ip2, rx_fib_index2, is_output); - ti[3] = sm->worker_in2out_cb (b[3], ip3, rx_fib_index3, is_output); + ti[0] = nat44_ed_get_in2out_worker_index (b[0], ip0, rx_fib_index0, + is_output); + ti[1] = nat44_ed_get_in2out_worker_index (b[1], ip1, rx_fib_index1, + is_output); + ti[2] = nat44_ed_get_in2out_worker_index (b[2], ip2, rx_fib_index2, + is_output); + ti[3] = nat44_ed_get_in2out_worker_index (b[3], 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); + ti[0] = nat44_ed_get_out2in_worker_index (b[0], ip0, rx_fib_index0, + is_output); + ti[1] = nat44_ed_get_out2in_worker_index (b[1], ip1, rx_fib_index1, + is_output); + ti[2] = nat44_ed_get_out2in_worker_index (b[2], ip2, rx_fib_index2, + is_output); + ti[3] = nat44_ed_get_out2in_worker_index (b[3], ip3, rx_fib_index3, + is_output); } if (ti[0] == thread_index) @@ -218,11 +226,13 @@ nat44_worker_handoff_fn_inline (vlib_main_t * vm, if (is_in2out) { - ti[0] = sm->worker_in2out_cb (b[0], ip0, rx_fib_index0, is_output); + ti[0] = nat44_ed_get_in2out_worker_index (b[0], ip0, rx_fib_index0, + is_output); } else { - ti[0] = sm->worker_out2in_cb (b[0], ip0, rx_fib_index0, is_output); + ti[0] = nat44_ed_get_out2in_worker_index (b[0], ip0, rx_fib_index0, + is_output); } if (ti[0] == thread_index) -- cgit 1.2.3-korg