fib: fix coverity warning/don't dereference NULL
[vpp.git] / src / vnet / interface_format.c
index 86a3d59..cb428e7 100644 (file)
@@ -43,6 +43,7 @@
 #include <vnet/l2/l2_output.h>
 #include <vnet/l2/l2_vtr.h>
 #include <vnet/interface/rx_queue_funcs.h>
+#include <vnet/interface/tx_queue_funcs.h>
 
 u8 *
 format_vtr (u8 * s, va_list * args)
@@ -208,6 +209,25 @@ format_vnet_hw_interface (u8 * s, va_list * args)
        }
     }
 
+  if (vec_len (hi->tx_queue_indices))
+    {
+      s = format (s, "\n%UTX Queues:", format_white_space, indent + 2);
+      s = format (
+       s, "\n%UTX Hash: %U", format_white_space, indent + 4, format_vnet_hash,
+       vnet_hash_function_from_func (hi->hf, hw_class->tx_hash_fn_type));
+      s = format (s, "\n%U%-6s%-7s%-15s", format_white_space, indent + 4,
+                 "queue", "shared", "thread(s)");
+      for (int i = 0; i < vec_len (hi->tx_queue_indices); i++)
+       {
+         vnet_hw_if_tx_queue_t *txq;
+         txq = vnet_hw_if_get_tx_queue (vnm, hi->tx_queue_indices[i]);
+         s = format (
+           s, "\n%U%-6u%-7s%U", format_white_space, indent + 4, txq->queue_id,
+           clib_bitmap_count_set_bits (txq->threads) > 1 ? "yes" : "no",
+           format_bitmap_list, txq->threads);
+       }
+    }
+
   if (hi->rss_queues)
     {
       s = format (s, "\n%URSS queues: %U", format_white_space, indent + 2,