Re: [PATCH v8] virtio-net: Fix network stall at the host side waiting for kick

2024-07-05 Thread Yang Dongshan
> > static int virtio_net_has_buffers(VirtIONetQueue *q, int bufsize) > > { > > + int shadow_idx; > > + unsigned int in_bytes; > > VirtIONet *n = q->n; > > - if (virtio_queue_empty(q->rx_vq) || > > - (n->mergeable_rx_bufs && > > - !virtqueue_avail_bytes(q->rx_vq, bufsize, 0))) { > > - virtio_queue_

Re: [PATCH v7] virtio-net: Fix network stall at the host side waiting for kick

2024-07-04 Thread Yang Dongshan
irectly and change the function name to virtio_queue_set_notification_and_check_shadow()? On 2024/7/4, 19:24, "Michael S. Tsirkin" mailto:m...@redhat.com>> wrote: On Thu, Jul 04, 2024 at 10:20:15AM +, Yang Dongshan wrote: > Hi, Michael > > > My suggestion: > > > > > >

Re: [PATCH v7] virtio-net: Fix network stall at the host side waiting for kick

2024-07-04 Thread Yang Dongshan
y, should I add an API to get the shadow idx as virtio_queue_set_notification_and_check() needs the opaque arg. What value should return from virtqueue_get_avail_bytes() in case of error branch in the function? On 2024/7/2, 19:27, "Michael S. Tsirkin" mailto:m...@redhat.com>> wrote: On Tue, Jul 02, 2024 at 07:4

Re: [PATCH v7] virtio-net: Fix network stall at the host side waiting for kick

2024-07-02 Thread Yang Dongshan
queue since that value >was returned. I'm not clear about the purpose of virtqueue_poll(), when will the function return? Do you mean that loop in virtqueue_poll() till new buffers become available? > accordingly, virtio_queue_set_notification_and_check > will accept this opaq

Re: [PATCH v7] virtio-net: Fix network stall at the host side waiting for kick

2024-07-01 Thread Yang Dongshan
adow_avail_wrap_counter))* *return true;* On Tue, Jul 2, 2024 at 2:46 AM Michael S. Tsirkin wrote: > On Tue, Jul 02, 2024 at 01:18:15AM +0800, Yang Dongshan wrote: > > > Please document what this does. > > okay, i will. > > > > > So this will return f

Re: [PATCH v7] virtio-net: Fix network stall at the host side waiting for kick

2024-07-01 Thread Yang Dongshan
> Please document what this does. okay, i will. > So this will return false if ring has any available buffers? > Equivalent to: > > bool virtio_queue_set_notification_and_check(VirtQueue *vq, int enable) > { >virtio_queue_packed_set_notification(vq, enable); > return virtio_queue_e

Re: [PATCH] Update event idx if guest has made extra buffers during double check

2024-06-17 Thread Yang Dongshan
hi, subject should list the affected component, and be shorter. ok, I will rewrite the subject: "update the latest available idx seen by the host to event idx" Fixes: 06b12970174 ("virtio-net: fix network stall under load") this should come at the end. I have submitted v2, it's at the end now.