summaryrefslogtreecommitdiffstats
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.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/vnet/devices/virtio/virtio.c b/src/vnet/devices/virtio/virtio.c
index 4f812b1e7aa..b8054d13e5b 100644
--- a/src/vnet/devices/virtio/virtio.c
+++ b/src/vnet/devices/virtio/virtio.c
@@ -30,6 +30,7 @@
#include <vnet/ip/ip4_packet.h>
#include <vnet/ip/ip6_packet.h>
#include <vnet/devices/virtio/virtio.h>
+#include <vnet/devices/virtio/virtio_inline.h>
#include <vnet/devices/virtio/pci.h>
#include <vnet/interface/rx_queue_funcs.h>
@@ -220,6 +221,19 @@ virtio_set_packet_buffering (virtio_if_t * vif, u16 buffering_size)
return error;
}
+static void
+virtio_vring_fill (vlib_main_t *vm, virtio_if_t *vif, virtio_vring_t *vring)
+{
+ if (vif->is_packed)
+ virtio_refill_vring_packed (vm, vif, vif->type, vring,
+ vif->virtio_net_hdr_sz,
+ virtio_input_node.index);
+ else
+ virtio_refill_vring_split (vm, vif, vif->type, vring,
+ vif->virtio_net_hdr_sz,
+ virtio_input_node.index);
+}
+
void
virtio_vring_set_rx_queues (vlib_main_t *vm, virtio_if_t *vif)
{
@@ -262,6 +276,10 @@ virtio_vring_set_rx_queues (vlib_main_t *vm, virtio_if_t *vif)
file_index);
i++;
}
+ vnet_hw_if_set_rx_queue_mode (vnm, vring->queue_index,
+ VNET_HW_IF_RX_MODE_POLLING);
+ vring->mode = VNET_HW_IF_RX_MODE_POLLING;
+ virtio_vring_fill (vm, vif, vring);
}
vnet_hw_if_update_runtime_data (vnm, vif->hw_if_index);
}