Browse Source

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: 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>
pull/106/head
Oleinik, Alexander 7 years ago
committed by Thomas Huth
parent
commit
375eae1c71
  1. 1
      tests/libqos/virtio-net.c
  2. 2
      tests/libqos/virtio-net.h

1
tests/libqos/virtio-net.c

@ -53,6 +53,7 @@ static void virtio_net_setup(QVirtioNet *interface)
} else { } else {
interface->n_queues = 2; interface->n_queues = 2;
} }
interface->n_queues++; /* Account for the ctrl queue */
interface->queues = g_new(QVirtQueue *, interface->n_queues); interface->queues = g_new(QVirtQueue *, interface->n_queues);
for (i = 0; i < interface->n_queues; i++) { for (i = 0; i < interface->n_queues; i++) {

2
tests/libqos/virtio-net.h

@ -29,7 +29,7 @@ typedef struct QVirtioNetDevice QVirtioNetDevice;
struct QVirtioNet { struct QVirtioNet {
QVirtioDevice *vdev; QVirtioDevice *vdev;
int n_queues; int n_queues; /* total number of virtqueues (rx, tx, ctrl) */
QVirtQueue **queues; QVirtQueue **queues;
}; };

Loading…
Cancel
Save