From 16b2977562874daa3bfab32860b01b497882bc43 Mon Sep 17 00:00:00 2001 From: Maxime Coquelin Date: Tue, 12 Jul 2022 12:04:47 +0200 Subject: [PATCH] vhost: fix missing copy length in batched copies This patch fixes missing the assignment of the copy length when doing batched copies in the sync dequeue path. Fixes: cd79d1b030bd ("vhost: fix unnecessary dirty page logging") Suggested-by: Chenbo Xia Signed-off-by: Maxime Coquelin Reviewed-by: Chenbo Xia Tested-by: Wei Ling --- lib/vhost/virtio_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c index 12b7fbe7f9..35fa4670fd 100644 --- a/lib/vhost/virtio_net.c +++ b/lib/vhost/virtio_net.c @@ -1127,13 +1127,13 @@ sync_fill_seg(struct virtio_net *dev, struct vhost_virtqueue *vq, batch_copy[vq->batch_copy_nb_elems].src = rte_pktmbuf_mtod_offset(m, void *, mbuf_offset); batch_copy[vq->batch_copy_nb_elems].log_addr = buf_iova; - batch_copy[vq->batch_copy_nb_elems].len = cpy_len; } else { batch_copy[vq->batch_copy_nb_elems].dst = rte_pktmbuf_mtod_offset(m, void *, mbuf_offset); batch_copy[vq->batch_copy_nb_elems].src = (void *)((uintptr_t)(buf_addr)); } + batch_copy[vq->batch_copy_nb_elems].len = cpy_len; vq->batch_copy_nb_elems++; } }