OSDN Git Service

libqos: Account for the ctrl queue in virtio-net
authorOleinik, Alexander <alxndr@bu.edu>
Mon, 5 Aug 2019 03:24:15 +0000 (03:24 +0000)
committerThomas Huth <thuth@redhat.com>
Thu, 15 Aug 2019 17:23:59 +0000 (19:23 +0200)
The number of queues is 2n+1, where n == 1 when multiqueue is disabled

Signed-off-by: Alexander Oleinik <alxndr@bu.edu>
Message-Id: <20190805032400.8054-1-alxndr@bu.edu>
[thuth: fixed "intefaces" typo]
Signed-off-by: Thomas Huth <thuth@redhat.com>
tests/libqos/virtio-net.c
tests/libqos/virtio-net.h

index 66405b6..6567beb 100644 (file)
@@ -53,6 +53,7 @@ static void virtio_net_setup(QVirtioNet *interface)
     } else {
         interface->n_queues = 2;
     }
+    interface->n_queues++; /* Account for the ctrl queue */
 
     interface->queues = g_new(QVirtQueue *, interface->n_queues);
     for (i = 0; i < interface->n_queues; i++) {
index a5697d7..855c67d 100644 (file)
@@ -29,7 +29,7 @@ typedef struct QVirtioNetDevice QVirtioNetDevice;
 
 struct QVirtioNet {
     QVirtioDevice *vdev;
-    int n_queues;
+    int n_queues; /* total number of virtqueues (rx, tx, ctrl) */
     QVirtQueue **queues;
 };