virtio: Add RX queue full statisitics 76/40576/2
authorSteven Luong <sluong@cisco.com>
Wed, 20 Mar 2024 19:28:49 +0000 (12:28 -0700)
committerBeno�t Ganne <bganne@cisco.com>
Thu, 23 May 2024 17:50:50 +0000 (17:50 +0000)
In production network, often the host and the vm are managed by different
groups. The host statistics may not be readily available to the folks who
manage the VM. Having the RX queue full statistics in VPP can inform
that there might possibly be drops in the host.

Type: improvement

Change-Id: I43206647ac0d8092968c4187236d9696ae0acccd
Signed-off-by: Steven Luong <sluong@cisco.com>
src/vnet/devices/virtio/node.c
src/vnet/devices/virtio/virtio_inline.h

index 8c83757..027e1ed 100644 (file)
@@ -282,6 +282,16 @@ virtio_device_input_gso_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
   if (n_left == 0)
     return 0;
 
+  if (PREDICT_FALSE (n_left == vring->queue_size))
+    {
+      /*
+       * Informational error logging when VPP is not pulling packets fast
+       * enough.
+       */
+      vlib_error_count (vm, node->node_index, VIRTIO_INPUT_ERROR_FULL_RX_QUEUE,
+                       1);
+    }
+
   if (type == VIRTIO_IF_TYPE_TUN)
     {
       next_index = VNET_DEVICE_INPUT_NEXT_IP4_INPUT;
index 179f319..41bba75 100644 (file)
@@ -17,6 +17,7 @@
 
 #define foreach_virtio_input_error                                            \
   _ (BUFFER_ALLOC, "buffer alloc error")                                      \
+  _ (FULL_RX_QUEUE, "full rx queue (driver tx drop)")                         \
   _ (UNKNOWN, "unknown")
 
 typedef enum