ipsec: Use the new tunnel API types to add flow label and TTL copy
[vpp.git] / src / vnet / interface_format.c
index 5f995b8..dc2edff 100644 (file)
@@ -42,6 +42,7 @@
 #include <vnet/l2/l2_input.h>
 #include <vnet/l2/l2_output.h>
 #include <vnet/l2/l2_vtr.h>
+#include <vnet/interface/rx_queue_funcs.h>
 
 u8 *
 format_vtr (u8 * s, va_list * args)
@@ -97,17 +98,17 @@ format_vnet_sw_interface_flags (u8 * s, va_list * args)
 }
 
 u8 *
-format_vnet_hw_interface_rx_mode (u8 * s, va_list * args)
+format_vnet_hw_if_rx_mode (u8 * s, va_list * args)
 {
-  vnet_hw_interface_rx_mode mode = va_arg (*args, vnet_hw_interface_rx_mode);
+  vnet_hw_if_rx_mode mode = va_arg (*args, vnet_hw_if_rx_mode);
 
-  if (mode == VNET_HW_INTERFACE_RX_MODE_POLLING)
+  if (mode == VNET_HW_IF_RX_MODE_POLLING)
     return format (s, "polling");
 
-  if (mode == VNET_HW_INTERFACE_RX_MODE_INTERRUPT)
+  if (mode == VNET_HW_IF_RX_MODE_INTERRUPT)
     return format (s, "interrupt");
 
-  if (mode == VNET_HW_INTERFACE_RX_MODE_ADAPTIVE)
+  if (mode == VNET_HW_IF_RX_MODE_ADAPTIVE)
     return format (s, "adaptive");
 
   return format (s, "unknown");
@@ -142,9 +143,9 @@ format_vnet_hw_interface_rss_queues (u8 * s, va_list * args)
   if (bitmap)
     {
     /* *INDENT-OFF* */
-    clib_bitmap_foreach (i, bitmap, ({
+    clib_bitmap_foreach (i, bitmap)  {
       s = format (s, "%u ", i);
-    }));
+    }
     /* *INDENT-ON* */
     }
 
@@ -181,8 +182,8 @@ format_vnet_hw_interface (u8 * s, va_list * args)
     {
       int hw_idx;
       s = format (s, "Slave-Idx:");
-      clib_bitmap_foreach (hw_idx, hi->bond_info, s =
-                          format (s, " %d", hw_idx));
+      clib_bitmap_foreach (hw_idx, hi->bond_info)
+       s = format (s, " %d", hw_idx);
     }
   else if (dev_class->format_device_name)
     s = format (s, "%U", dev_class->format_device_name, hi->dev_instance);
@@ -192,6 +193,21 @@ format_vnet_hw_interface (u8 * s, va_list * args)
   s = format (s, "\n%ULink speed: %U", format_white_space, indent + 2,
              format_vnet_hw_interface_link_speed, hi->link_speed);
 
+  if (vec_len (hi->rx_queue_indices))
+    {
+      s = format (s, "\n%URX Queues:", format_white_space, indent + 2);
+      s = format (s, "\n%U%-6s%-15s%-10s", format_white_space, indent + 4,
+                 "queue", "thread", "mode");
+      for (int i = 0; i < vec_len (hi->rx_queue_indices); i++)
+       {
+         vnet_hw_if_rx_queue_t *rxq;
+         rxq = vnet_hw_if_get_rx_queue (vnm, hi->rx_queue_indices[i]);
+         s = format (s, "\n%U%-6u%-15U%-10U", format_white_space, indent + 4,
+                     rxq->queue_id, format_vlib_thread_name_and_index,
+                     rxq->thread_index, format_vnet_hw_if_rx_mode, rxq->mode);
+       }
+    }
+
   if (hi->rss_queues)
     {
       s = format (s, "\n%URSS queues: %U", format_white_space, indent + 2,