From 45847f015d6ed218cd86124ef91857b75f766a85 Mon Sep 17 00:00:00 2001 From: Yuanhan Liu Date: Fri, 14 Oct 2016 17:34:37 +0800 Subject: [PATCH] vhost: prefetch available ring Signed-off-by: Yuanhan Liu Signed-off-by: Zhihong Wang Reviewed-by: Jianbo Liu Tested-by: Maxime Coquelin --- lib/librte_vhost/virtio_net.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index b4a0760313..8f2ade1dfd 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -536,6 +536,8 @@ virtio_dev_merge_rx(struct virtio_net *dev, uint16_t queue_id, if (count == 0) return 0; + rte_prefetch0(&vq->avail->ring[vq->last_avail_idx & (vq->size - 1)]); + vq->shadow_used_idx = 0; for (pkt_idx = 0; pkt_idx < count; pkt_idx++) { uint32_t pkt_len = pkts[pkt_idx]->pkt_len + dev->vhost_hlen; -- 2.20.1