netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislav Fomichev <stfomichev@gmail.com>
To: Samiullah Khawaja <skhawaja@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
	"David S . Miller " <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	almasrymina@google.com, willemb@google.com,
	netdev@vger.kernel.org
Subject: Re: [PATCH net v2] xsk: Bring back busy polling support in XDP_COPY
Date: Fri, 16 May 2025 15:00:39 -0700	[thread overview]
Message-ID: <aCe1h8tNaEqqUlO0@mini-arch> (raw)
In-Reply-To: <20250516213638.1889546-1-skhawaja@google.com>

On 05/16, Samiullah Khawaja wrote:
> Commit 5ef44b3cb43b ("xsk: Bring back busy polling support") fixed the
> busy polling support in xsk for XDP_ZEROCOPY after it was broken in
> commit 86e25f40aa1e ("net: napi: Add napi_config"). The busy polling
> support with XDP_COPY remained broken since the napi_id setup in
> xsk_rcv_check was removed.
> 
> Bring back the setup of napi_id for XDP_COPY so socket level SO_BUSYPOLL
> can be used to poll the underlying napi.
> 
> Do the setup of napi_id for XDP_COPY in xsk_bind, as it is done
> currently for XDP_ZEROCOPY. The setup of napi_id for XDP_COPY in
> xsk_bind is safe because xsk_rcv_check checks that the rx queue at which
> the packet arrives is equal to the queue_id that was supplied in bind.
> This is done for both XDP_COPY and XDP_ZEROCOPY mode.
> 
> Tested using AF_XDP support in virtio-net by running the xsk_rr AF_XDP
> benchmarking tool shared here:
> https://lore.kernel.org/all/20250320163523.3501305-1-skhawaja@google.com/T/
> 
> Enabled socket busy polling using following commands in qemu,
> 
> ```
> sudo ethtool -L eth0 combined 1
> echo 400 | sudo tee /proc/sys/net/core/busy_read
> echo 100 | sudo tee /sys/class/net/eth0/napi_defer_hard_irqs
> echo 15000   | sudo tee /sys/class/net/eth0/gro_flush_timeout
> ```
> 
> Fixes: 5ef44b3cb43b ("xsk: Bring back busy polling support")
> Signed-off-by: Samiullah Khawaja <skhawaja@google.com>
> Reviewed-by: Willem de Bruijn <willemb@google.com>

Acked-by: Stanislav Fomichev <sdf@fomichev.me>

Looks good to me. But note that I never understood why those __sk_mark_napi_id_once
calls were there in the receive path in the first place. Presumably
because of the unstable napi ids. Now, with the napi config, it should
be safe to resolve both copy/non-copy modes during the bind.

  reply	other threads:[~2025-05-16 22:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-16 21:36 [PATCH net v2] xsk: Bring back busy polling support in XDP_COPY Samiullah Khawaja
2025-05-16 22:00 ` Stanislav Fomichev [this message]
2025-05-21  9:30 ` patchwork-bot+netdevbpf

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=aCe1h8tNaEqqUlO0@mini-arch \
    --to=stfomichev@gmail.com \
    --cc=almasrymina@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=skhawaja@google.com \
    --cc=willemb@google.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;
as well as URLs for NNTP newsgroup(s).