RE: [PATCH 1/1] vhost: fix a double fetch when dequeue offloading

2024-12-22 Thread Wangyunjian(wangyunjian,TongTu)
) ; > wangzengyuan ; sta...@dpdk.org > Subject: Re: [PATCH 1/1] vhost: fix a double fetch when dequeue offloading > > On Thu, 19 Dec 2024 14:38:28 +0800 > Yunjian Wang wrote: > > > diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c > > index 69901ab3b5..5c

Re: [PATCH 1/1] vhost: fix a double fetch when dequeue offloading

2024-12-20 Thread Stephen Hemminger
On Thu, 19 Dec 2024 14:38:28 +0800 Yunjian Wang wrote: > diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c > index 69901ab3b5..5c40ae7069 100644 > --- a/lib/vhost/virtio_net.c > +++ b/lib/vhost/virtio_net.c > @@ -2914,10 +2914,12 @@ desc_to_mbuf(struct virtio_net *dev, struct > vhost_

Re: [PATCH 1/1] vhost: fix a double fetch when dequeue offloading

2024-12-19 Thread Stephen Hemminger
> > Cc: dev@dpdk.org; maxime.coque...@redhat.com; chen...@nvidia.com; > > Lilijun (Jerry) ; xiawei (H) > > ; > > wangzengyuan ; sta...@dpdk.org > > Subject: Re: [PATCH 1/1] vhost: fix a double fetch when dequeue offloading > > > > On Thu, 19 Dec 2024 14:38:28

RE: [PATCH 1/1] vhost: fix a double fetch when dequeue offloading

2024-12-19 Thread Wangyunjian(wangyunjian,TongTu)
t; wangzengyuan ; sta...@dpdk.org > Subject: Re: [PATCH 1/1] vhost: fix a double fetch when dequeue offloading > > On Thu, 19 Dec 2024 14:38:28 +0800 > Yunjian Wang wrote: > > > - hdr = (struct virtio_net_hdr > > *)((uintptr_t)buf_vec[0].buf_addr); >

Re: [PATCH 1/1] vhost: fix a double fetch when dequeue offloading

2024-12-19 Thread Stephen Hemminger
On Thu, 19 Dec 2024 14:38:28 +0800 Yunjian Wang wrote: > - hdr = (struct virtio_net_hdr > *)((uintptr_t)buf_vec[0].buf_addr); > + rte_memcpy((void *)(uintptr_t)&tmp_hdr, > + (void *)(uintptr_t)buf_vec[0].buf_addr, > +

RE: [PATCH 1/1] vhost: fix a double fetch when dequeue offloading

2024-12-19 Thread Wangyunjian(wangyunjian,TongTu)
> wangzengyuan ; sta...@dpdk.org > Subject: Re: [PATCH 1/1] vhost: fix a double fetch when dequeue offloading > > On Thu, Dec 19, 2024 at 7:38 AM Yunjian Wang > wrote: > > > > The hdr->csum_start does two successive reads from user space to read a > > variab

Re: [PATCH 1/1] vhost: fix a double fetch when dequeue offloading

2024-12-19 Thread David Marchand
On Thu, Dec 19, 2024 at 7:38 AM Yunjian Wang wrote: > > The hdr->csum_start does two successive reads from user space to read a > variable length data structure. The result overflow if the data structure > changes between the two reads. > > To fix this, we can prevent double fetch issue by copying

[PATCH 1/1] vhost: fix a double fetch when dequeue offloading

2024-12-18 Thread Yunjian Wang
The hdr->csum_start does two successive reads from user space to read a variable length data structure. The result overflow if the data structure changes between the two reads. To fix this, we can prevent double fetch issue by copying virtio_hdr to the temporary variable. Fixes: 4dc4e33ffa10 ("ne