[RFC v1] net/af_packet: add io_uring TX acceleration

Scott Mitchell scott.k.mitch1 at gmail.com
Thu Feb 5 01:08:22 CET 2026


Can you send a link to the RFC patch? I found a discussion thread
https://mails.dpdk.org/archives/dev/2024-November/307925.html but some
of the discussion in this thread (use of epoll, independent FDs per Rx
and Tx, etc.) don't apply to af_packet which doesn't use system calls
on the data path, but only the sendto() notify on TX. Seems reasonable
that TAP could benefit from io_uring but not clear that needs to be
mutually exclusive to af_packet. Can you clarify?

On Wed, Feb 4, 2026 at 8:52 AM Stephen Hemminger
<stephen at networkplumber.org> wrote:
>
> On Wed,  4 Feb 2026 08:12:02 -0800
> scott.k.mitch1 at gmail.com wrote:
>
> > From: Scott <scott.k.mitch1 at 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 at 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


More information about the dev mailing list