Commit 375eae1c authored by Oleinik, Alexander's avatar Oleinik, Alexander Committed by Thomas Huth
Browse files

libqos: Account for the ctrl queue in virtio-net



The number of queues is 2n+1, where n == 1 when multiqueue is disabled

Signed-off-by: default avatarAlexander Oleinik <alxndr@bu.edu>
Message-Id: <20190805032400.8054-1-alxndr@bu.edu>
[thuth: fixed "intefaces" typo]
Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
parent 2b8985f1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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++) {
+1 −1
Original line number Diff line number Diff line
@@ -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;
};