nat: reduce number of hash tables for EI NAT
[vpp.git] / src / plugins / nat / nat44_cli.c
index d1a0871..c89963e 100644 (file)
@@ -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);
   }