From 6b3f1c0a9cf66f82cda1dc6b15982ee910671340 Mon Sep 17 00:00:00 2001 From: Klement Sekera Date: Tue, 26 Jan 2021 12:18:53 +0100 Subject: nat: reduce number of hash tables for EI NAT Making code more simple and storing thread index along with session index as a preparation step for fixing thread safety patches. Type: improvement Signed-off-by: Klement Sekera Change-Id: Ib0c531e9f1f64b1f1ee912d4a83279200638e931 --- src/plugins/nat/nat44_cli.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/plugins/nat/nat44_cli.c') diff --git a/src/plugins/nat/nat44_cli.c b/src/plugins/nat/nat44_cli.c index d1a08718ed7..c89963ec85a 100644 --- a/src/plugins/nat/nat44_cli.c +++ b/src/plugins/nat/nat44_cli.c @@ -300,22 +300,20 @@ nat44_show_hash_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_output (vm, "%U", format_bihash_8_8, &sm->static_mapping_by_external, verbose); - vlib_cli_output (vm, "%U", format_bihash_16_8, &sm->flow_hash, verbose); + if (sm->endpoint_dependent) + { + vlib_cli_output (vm, "%U", format_bihash_16_8, &sm->flow_hash, verbose); + } + else + { + vlib_cli_output (vm, "%U", format_bihash_8_8, &sm->in2out, verbose); + vlib_cli_output (vm, "%U", format_bihash_8_8, &sm->out2in, verbose); + } vec_foreach_index (i, sm->per_thread_data) { tsm = vec_elt_at_index (sm->per_thread_data, i); vlib_cli_output (vm, "-------- thread %d %s --------\n", i, vlib_worker_threads[i].name); - if (sm->endpoint_dependent) - { - vlib_cli_output (vm, "%U", format_bihash_16_8, &sm->flow_hash, - verbose); - } - else - { - vlib_cli_output (vm, "%U", format_bihash_8_8, &tsm->in2out, verbose); - vlib_cli_output (vm, "%U", format_bihash_8_8, &tsm->out2in, verbose); - } vlib_cli_output (vm, "%U", format_bihash_8_8, &tsm->user_hash, verbose); } -- cgit 1.2.3-korg