aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/virtio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/devices/virtio/virtio.c')
-rw-r--r--src/vnet/devices/virtio/virtio.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/vnet/devices/virtio/virtio.c b/src/vnet/devices/virtio/virtio.c
index 840936a43ff..682ec32ceff 100644
--- a/src/vnet/devices/virtio/virtio.c
+++ b/src/vnet/devices/virtio/virtio.c
@@ -294,6 +294,8 @@ virtio_vring_set_tx_queues (vlib_main_t *vm, virtio_if_t *vif)
{
vnet_main_t *vnm = vnet_get_main ();
vnet_virtio_vring_t *vring;
+ uword n_threads = vlib_get_n_threads ();
+ u8 consistent = vif->consistent_qp;
vec_foreach (vring, vif->txq_vrings)
{
@@ -308,10 +310,11 @@ virtio_vring_set_tx_queues (vlib_main_t *vm, virtio_if_t *vif)
return;
}
- for (u32 j = 0; j < vlib_get_n_threads (); j++)
+ for (u32 j = 0; j < n_threads; j++)
{
u32 qi = vif->txq_vrings[j % vif->num_txqs].queue_index;
- vnet_hw_if_tx_queue_assign_thread (vnm, qi, j);
+ vnet_hw_if_tx_queue_assign_thread (vnm, qi,
+ (j + consistent) % n_threads);
}
vnet_hw_if_update_runtime_data (vnm, vif->hw_if_index);