Netdev List
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: linux-kernel@vger.kernel.org, "Congjie Zhou" <zcjie0802@qq.com>,
	"Jason Wang" <jasowangio@gmail.com>,
	"Eugenio Pérez" <eperezma@redhat.com>,
	"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
	"Andrew Lunn" <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Simon Horman" <horms@kernel.org>,
	netdev@vger.kernel.org, virtualization@lists.linux.dev
Subject: Re: [PATCH net] virtio_net: mask callbacks before handing off NAPI ownership
Date: Mon, 23 Nov 2026 10:41:02 -0800	[thread overview]
Message-ID: <20261123104102.120856c6@kernel.org> (raw)
In-Reply-To: <ad74886a8429a862c00d1e42f1dc746f2924b75f.1795108341.git.mst@redhat.com>

On Thu, 19 Nov 2026 12:13:44 -0500 Michael S. Tsirkin wrote:
> Virtio is special in that enabling or disabling callbacks (interrupts)
> accesses shared virtqueue state and must be serialized with polling.
> It therefore enables callbacks before completing NAPI, and disables them
> again if completion returns false.
> 
> With napi_complete_done(), that false return can come after ownership has
> passed to another poll. The first poll can then disable callbacks after
> its successor has enabled them, leaving RX stalled. Virtio therefore
> needs to disable callbacks before handing off NAPI ownership.
> 
> Add a prepare/finish NAPI completion API so virtio-net can mask interrupts
> before handing ownership off.
> 
> Reported-by: Congjie Zhou <zcjie0802@qq.com>
> Closes: https://lore.kernel.org/netdev/tencent_D0650F8CA2AAE4C258BFE5BCE805CDB4CA0A@qq.com/
> Fixes: 6f8b12d661d0 ("net: napi: add hard irqs deferral feature")
> Message-ID: <20261119064843-mutt-send-email-mst@kernel.org>
> Assisted-by: LLM
> Tested-by: Congjie Zhou <zcjie0802@qq.com>

Not sure what model you used for this but it looks like shameful
slop. It'd be highly preferable to fix the driver. Highly preferable.
If messing with the core is unavoidable and doesn't cost any perf -
please look at the output of your LLM before you submit a patch :/
-- 
pw-bot: cr

      parent reply	other threads:[~2026-11-23 18:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 17:13 [PATCH net] virtio_net: mask callbacks before handing off NAPI ownership Michael S. Tsirkin
2026-11-23  5:14 ` netdev-bot+sashiko
2026-11-23 18:41 ` Jakub Kicinski [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=20261123104102.120856c6@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=eperezma@redhat.com \
    --cc=horms@kernel.org \
    --cc=jasowangio@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=virtualization@lists.linux.dev \
    --cc=xuanzhuo@linux.alibaba.com \
    --cc=zcjie0802@qq.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox