* [dpdk-dev] [PATCH] vhost: fix dequeue offload support
@ 2017-10-24 3:12 Tiwei Bie
2017-10-24 8:44 ` Yuanhan Liu
0 siblings, 1 reply; 2+ messages in thread
From: Tiwei Bie @ 2017-10-24 3:12 UTC (permalink / raw)
To: dev; +Cc: yliu, maxime.coquelin, lei.a.yao
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 <lei.a.yao@intel.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
---
lib/librte_vhost/virtio_net.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index b75c93c..3c6f1a5 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -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 +
--
2.7.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost: fix dequeue offload support
2017-10-24 3:12 [dpdk-dev] [PATCH] vhost: fix dequeue offload support Tiwei Bie
@ 2017-10-24 8:44 ` Yuanhan Liu
0 siblings, 0 replies; 2+ messages in thread
From: Yuanhan Liu @ 2017-10-24 8:44 UTC (permalink / raw)
To: Tiwei Bie; +Cc: dev, maxime.coquelin, lei.a.yao
On Tue, Oct 24, 2017 at 11:12:30AM +0800, Tiwei Bie wrote:
> 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 <lei.a.yao@intel.com>
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Applied to dpdk-next-virtio.
Thanks.
--yliu
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-24 8:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-24 3:12 [dpdk-dev] [PATCH] vhost: fix dequeue offload support Tiwei Bie
2017-10-24 8:44 ` Yuanhan Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).