From: Stephen Hemminger <stephen@networkplumber.org>
To: scott.k.mitch1@gmail.com
Cc: dev@dpdk.org
Subject: Re: [RFC v1] net/af_packet: add io_uring TX acceleration
Date: Wed, 4 Feb 2026 08:52:33 -0800 [thread overview]
Message-ID: <20260204085233.17c32e71@phoenix.local> (raw)
In-Reply-To: <20260204161202.36805-1-scott.k.mitch1@gmail.com>
On Wed, 4 Feb 2026 08:12:02 -0800
scott.k.mitch1@gmail.com wrote:
> From: Scott <scott.k.mitch1@gmail.com>
>
> When user space application does sendto() to notify the kernel
> there is data to process, the kernel synchronously processes
> pending frames and the CPU cost is attributed to the application.
> The kernel processing may also include kernel RX (netlink, ovs)
> and packet manipulation. This can negatively impact performance
> by limiting CPU to each dpdk network thread.
>
> io_uring offers a mode (SQPOLL) to offload this processing
> to a dedicated kernel thread. This makes the kernel processing
> asynchronous, which can improve throughput by 30%+. The trade-off
> is SQPOLL threads consume additional CPU but this follows the
> same principle as virtio backends, and enables use cases that
> can't adopt virtio (e.g. containerized workloads).
>
> This patch adds optional io_uring support for TX kick operations
> to replace synchronous sendto() syscalls. When enabled, uses
> SQPOLL mode with kernel-side submission polling for reduced
> syscall overhead.
>
> Features:
> - Optional liburing dependency (version >= 2.4 required)
> - SQPOLL mode with configurable idle timeout
> - CPU affinity for SQPOLL threads (IORING_SETUP_SQ_AFF)
> - Shared workqueue support (IORING_SETUP_ATTACH_WQ)
> - Registered file descriptors for IOSQE_FIXED_FILE optimization
> - Single issuer and cooperative taskrun optimizations when available
>
> New devargs:
> - tx_io_uring_enabled: Enable io_uring TX (default: 0)
> - tx_io_uring_sq_size: Submission queue size (default: 1024)
> - tx_io_uring_sq_thread_idle: SQPOLL idle timeout in ms (default: 500)
> - tx_io_uring_q_cpu: CPU affinity for SQPOLL threads (repeatable)
> - tx_io_uring_wq_num: Number of shared workqueues (default: 0)
>
> The TX path updates the ring tail pointer directly instead of calling
> io_uring_submit() to avoid the io_uring_enter syscall, relying on
> SQPOLL to pick up submissions. If the SQPOLL thread sleeps, we wake
> it with IORING_ENTER_SQ_WAKEUP.
>
> Falls back gracefully to sendto() when:
> - liburing is not available at compile time
> - SQPOLL is not supported by the kernel
> - io_uring initialization fails for any reason
>
> Signed-off-by: Scott <scott.k.mitch1@gmail.com>
> ---
> Depends-on: series-37248 ("af_packet correctness, performance, cksum")
>
> doc/guides/nics/af_packet.rst | 16 +-
> doc/guides/rel_notes/release_26_03.rst | 1 +
> drivers/net/af_packet/meson.build | 14 +
> drivers/net/af_packet/rte_eth_af_packet.c | 420 +++++++++++++++++++++-
> 4 files changed, 435 insertions(+), 16 deletions(-)
>
> diff --git a/doc/guides/nics/af_packet.rst b/doc/guides/nics/af_pac
I would rather it be a different driver than af_packet.
See my RFC patch for using io_uring
next prev parent reply other threads:[~2026-02-04 16:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-04 16:12 [RFC v1] net/af_packet: add io_uring TX acceleration scott.k.mitch1
2026-02-04 16:52 ` Stephen Hemminger [this message]
2026-02-05 0:08 ` Scott Mitchell
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=20260204085233.17c32e71@phoenix.local \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=scott.k.mitch1@gmail.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