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: cd79d1b030 ("vhost: fix unnecessary dirty page logging")

Suggested-by: Chenbo Xia <chenbo.xia@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Tested-by: Wei Ling <weix.ling@intel.com>
This commit is contained in:
Maxime Coquelin 2022-07-12 12:04:47 +02:00 committed by Thomas Monjalon
parent b3c781dbde
commit 16b2977562

View File

@ -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++;
}
}