vhost: fix batch enqueue only handle few packets
[dpdk.git] / lib / librte_vhost / virtio_net.c
index cde7498..21c3117 100644 (file)
@@ -1108,6 +1108,10 @@ virtio_dev_rx_batch_packed(struct virtio_net *dev,
                           pkts[i]->pkt_len);
        }
 
+       vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE)
+               vhost_log_cache_write_iova(dev, vq, descs[avail_idx + i].addr,
+                                          lens[i]);
+
        vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE)
                ids[i] = descs[avail_idx + i].id;
 
@@ -1155,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;