From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: <menglong8.dong@gmail.com>
Cc: <jasowang@redhat.com>, <mst@redhat.com>,
<xuanzhuo@linux.alibaba.com>, <eperezma@redhat.com>,
<andrew+netdev@lunn.ch>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<magnus.karlsson@intel.com>, <sdf@fomichev.me>,
<horms@kernel.org>, <ast@kernel.org>, <daniel@iogearbox.net>,
<hawk@kernel.org>, <john.fastabend@gmail.com>, <bjorn@kernel.org>,
<kerneljasonxing@gmail.com>, <netdev@vger.kernel.org>,
<virtualization@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
<bpf@vger.kernel.org>
Subject: Re: [PATCH net-next 0/3] xsk: support tx napi busy_poll
Date: Thu, 11 Jun 2026 20:40:17 +0200 [thread overview]
Message-ID: <aisBEUmSJa1vkFYo@boxer> (raw)
In-Reply-To: <20260611071242.2485058-1-dongml2@chinatelecom.cn>
On Thu, Jun 11, 2026 at 03:12:39PM +0800, menglong8.dong@gmail.com wrote:
> From: Menglong Dong <dongml2@chinatelecom.cn>
>
> For now, we use sk_busy_loop() in __xsk_sendmsg() to send the data in tx
> ring. The sk_busy_loop() will poll on the target NAPI. However, for the
> nic driver that support the tx napi, such as virtio-net, it can't schedule
> the tx NAPI, but only the rx NAPI. If we enable the busy_poll for xsk and
> use virtio-net, we can't send data, as the rx NAPI in virtio-net doesn't
> handle the packet sending.
Am I reading this right that you decided to break busy-poll support for
zero-copy drivers that happen to handle transmit side from Rx NAPI context
in favor of supporting virtio-net?
>
> Fix this by introduce the sk_tx_busy_loop(), which will poll on the tx
> NAPI if available. To get the tx NAPI from the napi_id, we add the
> "tx_napi" field to napi_struct, which is ugly :/
>
> Another choice is to call virtnet_xsk_xmit() in virtnet_poll() too. But
> this a little contradict the design of tx NAPI.
>
> Menglong Dong (3):
> net: busy-poll: introduce sk_tx_busy_loop()
> virtio_net: initialize napi.tx_napi in virtnet_alloc_queues()
> xsk: replace sk_busy_loop with sk_tx_busy_loop in __xsk_sendmsg()
>
> drivers/net/virtio_net.c | 1 +
> include/linux/netdevice.h | 1 +
> include/net/busy_poll.h | 41 ++++++++++++++++++++++++++++++++++++---
> net/core/dev.c | 23 +++++-----------------
> net/xdp/xsk.c | 2 +-
> 5 files changed, 46 insertions(+), 22 deletions(-)
>
> --
> 2.54.0
>
next prev parent reply other threads:[~2026-06-11 18:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-11 7:12 [PATCH net-next 0/3] xsk: support tx napi busy_poll menglong8.dong
2026-06-11 7:12 ` [PATCH net-next 1/3] net: busy-poll: introduce sk_tx_busy_loop() menglong8.dong
2026-06-11 7:12 ` [PATCH net-next 2/3] virtio_net: initialize napi.tx_napi in virtnet_alloc_queues() menglong8.dong
2026-06-11 7:12 ` [PATCH net-next 3/3] xsk: replace sk_busy_loop with sk_tx_busy_loop in __xsk_sendmsg() menglong8.dong
2026-06-11 18:40 ` Maciej Fijalkowski [this message]
2026-06-12 1:09 ` [PATCH net-next 0/3] xsk: support tx napi busy_poll Menglong Dong
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=aisBEUmSJa1vkFYo@boxer \
--to=maciej.fijalkowski@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=ast@kernel.org \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eperezma@redhat.com \
--cc=hawk@kernel.org \
--cc=horms@kernel.org \
--cc=jasowang@redhat.com \
--cc=john.fastabend@gmail.com \
--cc=kerneljasonxing@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=magnus.karlsson@intel.com \
--cc=menglong8.dong@gmail.com \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.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 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.