summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat44_cli.c
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2021-01-26 12:18:53 +0100
committerOle Tr�an <otroan@employees.org>2021-02-04 14:35:43 +0000
commit6b3f1c0a9cf66f82cda1dc6b15982ee910671340 (patch)
tree5cb27b76f68f82421e0f1aca2a80b818fc220957 /src/plugins/nat/nat44_cli.c
parent92e9caea3b1bea837b4061a8328361ed166e5eab (diff)
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 <ksekera@cisco.com> Change-Id: Ib0c531e9f1f64b1f1ee912d4a83279200638e931
Diffstat (limited to 'src/plugins/nat/nat44_cli.c')
-rw-r--r--src/plugins/nat/nat44_cli.c20
1 files changed, 9 insertions, 11 deletions
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);
}