net/rtap: add io_uring based TAP driver
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v6 Latest11 patches 2 repliesIn review
- v510 patches 1 replySuperseded
Changes in v6 from the cover letter
- fix lots of bugs found doing automated review
- convert to use ifindex and netlink to avoid rename issues
- implement xstats
Patches in v6 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/11 | net/rtap: add driver skeleton and documentationMAINTAINERS doc/ doc/ +6 more | +414 | 0 replies | |
| 2/11 | net/rtap: add TAP device creation and queue managementdrivers/ drivers/ drivers/ +1 more | +689 | 0 replies | |
| 3/11 | net/rtap: add Rx/Tx with scatter/gather supportdoc/ drivers/ drivers/ +2 more | +793 | 0 replies | |
| 4/11 | net/rtap: add statistics and device infodoc/ drivers/ drivers/ | +124 | 0 replies | |
| 5/11 | net/rtap: add link and device management operationsdoc/ drivers/ drivers/ | +107 | 0 replies | |
| 6/11 | net/rtap: add checksum and TSO offload supportdoc/ drivers/ | +31 | 0 replies | |
| 7/11 | net/rtap: add multi-process supportdoc/ drivers/ | +141 | 0 replies | |
| 8/11 | net/rtap: add link state change interruptdoc/ drivers/ drivers/ +2 more | +118 | 0 replies | |
| 9/11 | net/rtap: add Rx interrupt supportdoc/ drivers/ drivers/ +2 more | +183 | 0 replies | |
| 10/11 | net/rtap: add extended statistics supportdoc/ drivers/ drivers/ +3 more | +342 | 0 replies | |
| 11/11 | test: add unit tests for rtap PMDapp/ app/ | +2621 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v6 yet.
Cover letter [PATCH v6 00/11] net/rtap: add io_uring based TAP driver
This series adds net_rtap, an experimental poll mode driver that uses Linux io_uring for asynchronous packet I/O with kernel TAP interfaces.
Like net_tap, net_rtap creates a kernel network interface visible to standard tools (ip, ethtool) and the Linux TCP/IP stack. From DPDK it is an ordinary ethdev.
Motivation
----------
This driver started as an experiment to determine whether Linux io_uring could deliver better packet I/O performance than the traditional read()/write() system calls used by net_tap. By posting batches of I/O requests asynchronously, io_uring amortizes system call overhead across multiple packets.
The project also served as a testbed for using AI tooling to help build a comprehensive test suite, refactor code, and improve documentation. The result is intended as an example for other PMD
authors: the driver has thorough unit tests covering data path, offloads, multi-queue, fd lifecycle, and more, along with detailed code comments explaining design choices.
Why not extend net_tap?
-----------------------
The existing net_tap driver was designed to provide feature parity with mlx5 when used behind the failsafe PMD. That goal led to significant complexity: rte_flow support emulated via eBPF programs, software GSO implementation, and other features that duplicate in user space what the kernel already does.
net_rtap takes the opposite approach -- use the kernel efficiently and let it do what it does well. There is no rte_flow support; receive queue selection is left to the kernel's native RSS/steering. There is no software GSO; the driver passes segmentation requests to the kernel via the virtio-net header and lets the kernel handle it. The result is a much simpler driver that is easier to maintain and reason about.
Given these fundamentally different design goals, a clean implementation was more practical than refactoring net_tap.
Acknowledgement
---------------
Parts of the test suite, code review, and refactoring were done with the assistance of Anthropic Claude (AI). All generated code was reviewed and tested by the author.
Requirements:
- Kernel headers with IORING_ASYNC_CANCEL_ALL (upstream since 5.19)
- liburing >= 2.0
Should work on distributions: Debian 12+, Ubuntu 24.04+, Fedora 37+, SLES 15 SP6+ / openSUSE Tumbleweed. RHEL 9 is not supported (io_uring is disabled by default).
v6:
- fix lots of bugs found doing automated review
- convert to use ifindex and netlink to avoid rename issues
- implement xstats
Stephen Hemminger (11):
net/rtap: add driver skeleton and documentation net/rtap: add TAP device creation and queue management net/rtap: add Rx/Tx with scatter/gather support net/rtap: add statistics and device info net/rtap: add link and device management operations net/rtap: add checksum and TSO offload support net/rtap: add multi-process support
net/rtap: add link state change interrupt net/rtap: add Rx interrupt support
net/rtap: add extended statistics support
test: add unit tests for rtap PMD
MAINTAINERS | 7 + app/test/meson.build | 1 + app/test/test_pmd_rtap.c | 2620 ++++++++++++++++++++++++ doc/guides/nics/features/rtap.ini | 26 + doc/guides/nics/index.rst | 1 + doc/guides/nics/rtap.rst | 101 + doc/guides/rel_notes/release_26_03.rst | 7 + drivers/net/meson.build | 1 + drivers/net/rtap/meson.build | 30 + drivers/net/rtap/rtap.h | 152 ++ drivers/net/rtap/rtap_ethdev.c | 864 ++++++++ drivers/net/rtap/rtap_intr.c | 207 ++ drivers/net/rtap/rtap_netlink.c | 445 ++++ drivers/net/rtap/rtap_rxtx.c | 803 ++++++++ drivers/net/rtap/rtap_xstats.c | 293 +++ 15 files changed, 5558 insertions(+) create mode 100644 app/test/test_pmd_rtap.c create mode 100644 doc/guides/nics/features/rtap.ini create mode 100644 doc/guides/nics/rtap.rst create mode 100644 drivers/net/rtap/meson.build create mode 100644 drivers/net/rtap/rtap.h create mode 100644 drivers/net/rtap/rtap_ethdev.c create mode 100644 drivers/net/rtap/rtap_intr.c create mode 100644 drivers/net/rtap/rtap_netlink.c create mode 100644 drivers/net/rtap/rtap_rxtx.c create mode 100644 drivers/net/rtap/rtap_xstats.c
Signature · 1 line
2.51.0