From: Stefano Brivio <sbrivio@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>
Cc: passt-dev@passt.top, David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH v2] udp_vu: Discard datagrams when RX virtqueue is not usable
Date: Sun, 11 Jan 2026 00:33:52 +0100 [thread overview]
Message-ID: <20260111003352.455a9005@elisabeth> (raw)
In-Reply-To: <20260107080809.3440007-1-lvivier@redhat.com>
On Wed, 7 Jan 2026 09:08:09 +0100
Laurent Vivier <lvivier@redhat.com> wrote:
> During vhost-user device initialization, UDP datagrams may arrive on
> listening sockets before the guest has enabled the RX virtqueue.
>
> When this happens, udp_vu_sock_recv() returns 0 without consuming
> the datagram from the socket. The caller, udp_sock_fwd(), uses a
> while loop with udp_peek_addr() to process pending datagrams. Since
> the datagram remains in the socket buffer, udp_peek_addr() keeps
> returning data available, causing a busy loop with 100% CPU usage.
>
> To avoid that, we need to discard the data when the virtqueue is not
> ready. udp_buf_sock_to_tap() actually does the same as it reads data
> with udp_sock_recv() and if fd_tap is not initialized tap_send_frames()
> drops them.
>
> Fixes: 28997fcb29b5 ("vhost-user: add vhost-user")
> Link: https://bugs.passt.top/show_bug.cgi?id=185
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
>
> Notes:
> v2:
> - move recvmsg() from udp_vu_sock_to_tap() to udp_vu_sock_recv()
Applied.
--
Stefano
prev parent reply other threads:[~2026-01-10 23:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-07 8:08 Laurent Vivier
2026-01-07 23:48 ` David Gibson
2026-01-08 7:13 ` Laurent Vivier
2026-01-08 23:38 ` David Gibson
2026-01-10 23:33 ` Stefano Brivio [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260111003352.455a9005@elisabeth \
--to=sbrivio@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=lvivier@redhat.com \
--cc=passt-dev@passt.top \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
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 IMAP folder(s).