All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: raoxu <raoxu@uniontech.com>
Cc: jasowangio@gmail.com, eperezma@redhat.com, kvm@vger.kernel.org,
	virtualization@lists.linux.dev, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vhost/net: Fix receive queue test in busy poll
Date: Thu, 19 Nov 2026 10:16:59 -0500	[thread overview]
Message-ID: <20261119101645-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <005FA5F7354482C7+20261110051642.249640-1-raoxu@uniontech.com>

On Tue, Nov 10, 2026 at 01:16:42PM +0800, raoxu wrote:
> From: Xu Rao <raoxu@uniontech.com>
> 
> sock_has_rx_data() returns a positive result when receive data is
> available. Socket implementations with a peek_len() callback follow
> that convention, but the fallback for sockets without one returns
> skb_queue_empty(), which has the opposite meaning.
> 
> This makes busy polling stop when a raw packet socket has no queued data
> and fail to recognize queued data through the fallback path. Return the
> negated queue-empty result so the fallback matches the callback and its
> callers.
> 
> Signed-off-by: Xu Rao <raoxu@uniontech.com>


do u want to send v2 addressing review?

> ---
>  drivers/vhost/net.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
> index 4570a4ffbab2..10ed2d55ff07 100644
> --- a/drivers/vhost/net.c
> +++ b/drivers/vhost/net.c
> @@ -538,7 +538,7 @@ static int sock_has_rx_data(struct socket *sock)
>  	if (sock->ops->peek_len)
>  		return sock->ops->peek_len(sock);
> 
> -	return skb_queue_empty(&sock->sk->sk_receive_queue);
> +	return !skb_queue_empty(&sock->sk->sk_receive_queue);
>  }
> 
>  static void vhost_net_busy_poll_try_queue(struct vhost_net *net,
> --
> 2.50.1


      parent reply	other threads:[~2026-11-19 15:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10  5:16 [PATCH] vhost/net: Fix receive queue test in busy poll raoxu
2026-11-11  5:19 ` sashiko-bot
2026-11-11 11:58 ` Björn Töpel
2026-11-19 15:16 ` Michael S. Tsirkin [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=20261119101645-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=eperezma@redhat.com \
    --cc=jasowangio@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=raoxu@uniontech.com \
    --cc=virtualization@lists.linux.dev \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.