dev: per-queue format callbacks 33/40133/1
authorDamjan Marion <damarion@cisco.com>
Thu, 21 Dec 2023 14:54:14 +0000 (15:54 +0100)
committerDamjan Marion <damarion@cisco.com>
Thu, 21 Dec 2023 14:55:39 +0000 (15:55 +0100)
Change-Id: Ia9fa6fab6288b4d0876022e72bf4f49bd00a19d2
Type: improvement
Signed-off-by: Damjan Marion <damarion@cisco.com>
src/vnet/dev/dev.h
src/vnet/dev/format.c

index 951e505..e7c6ca4 100644 (file)
@@ -115,6 +115,7 @@ typedef struct
   vnet_dev_rx_queue_op_t *start;
   vnet_dev_rx_queue_op_no_rv_t *stop;
   vnet_dev_rx_queue_op_no_rv_t *free;
+  format_function_t *format_info;
 } vnet_dev_rx_queue_ops_t;
 
 typedef struct
@@ -123,6 +124,7 @@ typedef struct
   vnet_dev_tx_queue_op_t *start;
   vnet_dev_tx_queue_op_no_rv_t *stop;
   vnet_dev_tx_queue_op_no_rv_t *free;
+  format_function_t *format_info;
 } vnet_dev_tx_queue_ops_t;
 
 typedef struct
index ff30161..848cd13 100644 (file)
@@ -163,6 +163,9 @@ format_vnet_dev_rx_queue_info (u8 *s, va_list *args)
              format_white_space, indent, rxq->rx_thread_index,
              rxq->enabled ? "en" : "dis", rxq->started ? "" : "not-",
              rxq->interrupt_mode ? "interrupt" : "polling");
+  if (rxq->port->rx_queue_ops.format_info)
+    s = format (s, "\n%U%U", format_white_space, indent,
+               rxq->port->rx_queue_ops.format_info, a, rxq);
 
   return s;
 }
@@ -184,6 +187,9 @@ format_vnet_dev_tx_queue_info (u8 *s, va_list *args)
   else
     s = format (s, "Used by thread%s %U", n > 1 ? "s" : "", format_bitmap_list,
                txq->assigned_threads);
+  if (txq->port->tx_queue_ops.format_info)
+    s = format (s, "\n%U%U", format_white_space, indent,
+               txq->port->tx_queue_ops.format_info, a, txq);
 
   return s;
 }