From: Marvin Liu Date: Thu, 7 Nov 2019 14:37:48 +0000 (+0800) Subject: vhost: fix batch enqueue only handle few packets X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=aa74c383d4ed636db26b50638e6d9f8ecb6280fd;p=dpdk.git vhost: fix batch enqueue only handle few packets After enqueue function finished, packet index has been increased. Batch enqueue function should retrieve mbuf structure pointed by that index. Fixes: 0294211bb6dc ("vhost: optimize packed ring enqueue") Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin --- diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index cb54ebe18c..21c311732a 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -1159,7 +1159,8 @@ virtio_dev_rx_packed(struct virtio_net *dev, rte_prefetch0(&vq->desc_packed[vq->last_avail_idx]); if (remained >= PACKED_BATCH_SIZE) { - if (!virtio_dev_rx_batch_packed(dev, vq, pkts)) { + if (!virtio_dev_rx_batch_packed(dev, vq, + &pkts[pkt_idx])) { pkt_idx += PACKED_BATCH_SIZE; remained -= PACKED_BATCH_SIZE; continue;