qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Update event idx if guest has made extra buffers during double check
@ 2024-06-17  5:45 thomas
  2024-08-11 17:45 ` Michael Tokarev
  2024-08-11 17:58 ` Michael S. Tsirkin
  0 siblings, 2 replies; 3+ messages in thread
From: thomas @ 2024-06-17  5:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: mst, jasowang, qemu-stable, thomas

If guest has made some buffers available during double check,
but the total buffer size available is lower than @bufsize,
notify the guest with the latest available idx(event idx)
seen by the host.

Fixes: 06b12970174 ("virtio-net: fix network stall under load")
Signed-off-by: wencheng Yang <east.moutain.yang@gmail.com>
---
 hw/net/virtio-net.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 9c7e85caea..23c6c8c898 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1654,6 +1654,7 @@ static int virtio_net_has_buffers(VirtIONetQueue *q, int bufsize)
         if (virtio_queue_empty(q->rx_vq) ||
             (n->mergeable_rx_bufs &&
              !virtqueue_avail_bytes(q->rx_vq, bufsize, 0))) {
+            virtio_queue_set_notification(q->rx_vq, 1);
             return 0;
         }
     }
-- 
2.39.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] Update event idx if guest has made extra buffers during double check
  2024-06-17  5:45 [PATCH v2] Update event idx if guest has made extra buffers during double check thomas
@ 2024-08-11 17:45 ` Michael Tokarev
  2024-08-11 17:58 ` Michael S. Tsirkin
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Tokarev @ 2024-08-11 17:45 UTC (permalink / raw)
  To: thomas, qemu-devel; +Cc: mst, jasowang, qemu-stable

17.06.2024 08:45, thomas wrote:
> If guest has made some buffers available during double check,
> but the total buffer size available is lower than @bufsize,
> notify the guest with the latest available idx(event idx)
> seen by the host.

Hi!

Has this change been forgotten, or is it not needed anymore?

Thanks,

/mjt

> Fixes: 06b12970174 ("virtio-net: fix network stall under load")
> Signed-off-by: wencheng Yang <east.moutain.yang@gmail.com>
> ---
>   hw/net/virtio-net.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index 9c7e85caea..23c6c8c898 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -1654,6 +1654,7 @@ static int virtio_net_has_buffers(VirtIONetQueue *q, int bufsize)
>           if (virtio_queue_empty(q->rx_vq) ||
>               (n->mergeable_rx_bufs &&
>                !virtqueue_avail_bytes(q->rx_vq, bufsize, 0))) {
> +            virtio_queue_set_notification(q->rx_vq, 1);
>               return 0;
>           }
>       }

-- 
GPG Key transition (from rsa2048 to rsa4096) since 2024-04-24.
New key: rsa4096/61AD3D98ECDF2C8E  9D8B E14E 3F2A 9DD7 9199  28F1 61AD 3D98 ECDF 2C8E
Old key: rsa2048/457CE0A0804465C5  6EE1 95D1 886E 8FFB 810D  4324 457C E0A0 8044 65C5
Transition statement: http://www.corpit.ru/mjt/gpg-transition-2024.txt



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] Update event idx if guest has made extra buffers during double check
  2024-06-17  5:45 [PATCH v2] Update event idx if guest has made extra buffers during double check thomas
  2024-08-11 17:45 ` Michael Tokarev
@ 2024-08-11 17:58 ` Michael S. Tsirkin
  1 sibling, 0 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2024-08-11 17:58 UTC (permalink / raw)
  To: thomas; +Cc: qemu-devel, jasowang, qemu-stable

On Mon, Jun 17, 2024 at 01:45:51PM +0800, thomas wrote:
> If guest has made some buffers available during double check,
> but the total buffer size available is lower than @bufsize,
> notify the guest with the latest available idx(event idx)
> seen by the host.
> 
> Fixes: 06b12970174 ("virtio-net: fix network stall under load")
> Signed-off-by: wencheng Yang <east.moutain.yang@gmail.com>
> ---
>  hw/net/virtio-net.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index 9c7e85caea..23c6c8c898 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -1654,6 +1654,7 @@ static int virtio_net_has_buffers(VirtIONetQueue *q, int bufsize)
>          if (virtio_queue_empty(q->rx_vq) ||
>              (n->mergeable_rx_bufs &&
>               !virtqueue_avail_bytes(q->rx_vq, bufsize, 0))) {
> +            virtio_queue_set_notification(q->rx_vq, 1);


This raises a lot of questions, but first of all virtio_queue_set_notification
does not notify guest, it enables guest notifications.

>              return 0;
>          }
>      }
> -- 
> 2.39.0



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-11 17:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-17  5:45 [PATCH v2] Update event idx if guest has made extra buffers during double check thomas
2024-08-11 17:45 ` Michael Tokarev
2024-08-11 17:58 ` Michael S. Tsirkin

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).