virtio: enable the interrupt support for uio_pci_generic
[vpp.git] / src / plugins / nat / nat44_cli.c
index adcf324..68c53d0 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->out2in_ed, 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, &tsm->in2out_ed,
-                        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);
   }
 
@@ -1893,6 +1891,42 @@ nat_show_timeouts_command_fn (vlib_main_t * vm,
   return 0;
 }
 
+static clib_error_t *
+set_frame_queue_nelts_command_fn (vlib_main_t *vm, unformat_input_t *input,
+                                 vlib_cli_command_t *cmd)
+{
+  unformat_input_t _line_input, *line_input = &_line_input;
+  clib_error_t *error = 0;
+  u32 frame_queue_nelts = 0;
+  /* Get a line of input. */
+  if (!unformat_user (input, unformat_line_input, line_input))
+    return 0;
+  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (line_input, "%u", &frame_queue_nelts))
+       ;
+      else
+       {
+         error = clib_error_return (0, "unknown input '%U'",
+                                    format_unformat_error, line_input);
+         goto done;
+       }
+    }
+  if (!frame_queue_nelts)
+    {
+      error = clib_error_return (0, "frame_queue_nelts cannot be zero");
+      goto done;
+    }
+  if (snat_set_frame_queue_nelts (frame_queue_nelts) != 0)
+    {
+      error = clib_error_return (0, "snat_set_frame_queue_nelts failed");
+      goto done;
+    }
+done:
+  unformat_free (line_input);
+  return error;
+}
+
 static clib_error_t *
 nat44_debug_fib_expire_command_fn (vlib_main_t * vm,
                                   unformat_input_t * input,
@@ -2067,6 +2101,18 @@ VLIB_CLI_COMMAND (nat_show_timeouts_command, static) = {
   .function = nat_show_timeouts_command_fn,
 };
 
+/*?
+ * @cliexpar
+ * @cliexstart{set nat frame-queue-nelts}
+ * Set number of worker handoff frame queue elements.
+ * @cliexend
+?*/
+VLIB_CLI_COMMAND (set_frame_queue_nelts_command, static) = {
+  .path = "set nat frame-queue-nelts",
+  .function = set_frame_queue_nelts_command_fn,
+  .short_help = "set nat frame-queue-nelts <number>",
+};
+
 /*?
  * @cliexpar
  * @cliexstart{nat set logging level}