Skip to content

io_uring: support IORING_OP_BIND and IORING_OP_LISTEN

Gabriel Krisman Bertazi io-uring netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5io_uring: Fix leak of async data when connect prep failsio_uring/net.c+5 -13 replies
2/5net: Split a __sys_bind helper for io_uringinclude/linux/socket.h net/socket.c+18 -91 reply
3/5net: Split a __sys_listen helper for io_uringinclude/linux/socket.h net/socket.c+15 -91 reply
4/5io_uring: Introduce IORING_OP_BINDinclude/uapi/linux/io_uring.h io_uring/net.c io_uring/net.h +1 more+59 -01 reply
5/5io_uring: Introduce IORING_OP_LISTENinclude/uapi/linux/io_uring.h io_uring/net.c io_uring/net.h +1 more+47 -01 reply

Reviews trailers per patch

2 of 5 patches have a Reviewed-by or Acked-by.

PatchJens Axboe
1/5
2/5R-b
3/5R-b
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/5] io_uring: support IORING_OP_BIND and IORING_OP_LISTEN

Following a discussion at LSFMM, this patchset introduces two new io_uring operations for bind(2) and listen(2).

The goal is to provide functional parity of registered files and direct file descriptors with regular fds for io_uring network operations. The cool outcome is that we can kickstart a network server solely with io_uring operations.

This feature has been requested several times in the past, including at:

https://github.com/axboe/liburing/issues/941

Regarding parameter organization within the SQE, specifically for bind(2), I'm following the implementation of IO_RING_CONECT. So, even though addr_len is expected to be an integer in the original syscall, I pass it through addr2, to match IO_RING_CONNECT. Other than that, the implementation is quite straightforward.

Patchset 1 fixes a memleak in IO_RING_CONNECT that you might want to apply ahead of the rest of the patchset; Patches 2 and 3 adapt the net/ side in preparation to support invocations from io_uring; patch 4 and 5 add the io_uring boilerplate.

I wrote liburing support, including tests. I'll follow with those patches shortly.

Gabriel Krisman Bertazi (5):
io_uring: Fix leak of async data when connect prep fails
net: Split a __sys_bind helper for io_uring
net: Split a __sys_listen helper for io_uring
io_uring: Introduce IORING_OP_BIND
io_uring: Introduce IORING_OP_LISTEN

 include/linux/socket.h        |  3 ++
 include/uapi/linux/io_uring.h |  2 +
 io_uring/net.c                | 78 ++++++++++++++++++++++++++++++++++-
 io_uring/net.h                |  6 +++
 io_uring/opdef.c              | 26 ++++++++++++
 net/socket.c                  | 48 +++++++++++++--------
 6 files changed, 144 insertions(+), 19 deletions(-)
Signature · 1 line
2.44.0