From a44c4e1e3a9277a51c7c5aca5c872f04c3524050 Mon Sep 17 00:00:00 2001 From: David Christensen Date: Mon, 30 Sep 2019 11:42:16 -0700 Subject: [PATCH] net/virtio: fix Rx AltiVec path by getting all packets The loop to read packets does not take all packets as the number of available packets (nb_used) is decremented in the loop. Fixes: 52b5a707e6ca ("net/virtio: add Altivec Rx") Signed-off-by: David Christensen Reviewed-by: Maxime Coquelin --- drivers/net/virtio/virtio_rxtx_simple_altivec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio/virtio_rxtx_simple_altivec.c b/drivers/net/virtio/virtio_rxtx_simple_altivec.c index f856396abe..47225f4121 100644 --- a/drivers/net/virtio/virtio_rxtx_simple_altivec.c +++ b/drivers/net/virtio/virtio_rxtx_simple_altivec.c @@ -44,7 +44,7 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, struct virtnet_rx *rxvq = rx_queue; struct virtqueue *vq = rxvq->vq; struct virtio_hw *hw = vq->hw; - uint16_t nb_used; + uint16_t nb_used, nb_total; uint16_t desc_idx; struct vring_used_elem *rused; struct rte_mbuf **sw_ring; @@ -109,9 +109,10 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, virtqueue_notify(vq); } + nb_total = nb_used; ref_rx_pkts = rx_pkts; for (nb_pkts_received = 0; - nb_pkts_received < nb_used;) { + nb_pkts_received < nb_total;) { vector unsigned char desc[RTE_VIRTIO_DESC_PER_LOOP / 2]; vector unsigned char mbp[RTE_VIRTIO_DESC_PER_LOOP / 2]; vector unsigned char pkt_mb[RTE_VIRTIO_DESC_PER_LOOP]; -- 2.20.1