vhost: fix dequeue offload support
PATCH 1/1 vhost: fix dequeue offload support
When offload is enabled, vhost needs to access the first mbuf to get the packet info, e.g. TCP header. So we couldn't delay the data copy in this case.
Fixes e5c494a7a22b ("vhost: batch small guest memory copies")
Reported-by Lei Yao <[email protected]>
Signed-off-by Tiwei Bie <[email protected]>
--- lib/librte_vhost/virtio_net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
lib/librte_vhost/virtio_net.c +2 -1
@@ -987,7 +987,8 @@ copy_desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq, mbuf_avail = cpy_len; }else {if (likely (cpy_len >MAX_BATCH_LEN || - copy_nb >= vq->size)) { + copy_nb >= vq->size || + (hdr && cur == m))) { rte_memcpy(rte_pktmbuf_mtod_offset(cur, void *, mbuf_offset), (void *)((uintptr_t)(desc_addr +
Signature · 1 line
2.7.4
Yuanhan Liu
AppliedQuoted 8 lines · Tiwei Bie
When offload is enabled, vhost needs to access the first mbuf to get the packet info, e.g. TCP header. So we couldn't delay the data copy in this case.
Fixes e5c494a7a22b ("vhost: batch small guest memory copies")Reported-by Lei Yao <[email protected]>Signed-off-by Tiwei Bie <[email protected]>
Applied to dpdk-next-virtio.
Thanks.
--yliu