public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/12] io_uring zcrx ifq sharing
@ 2025-11-03 23:40 David Wei
  2025-11-03 23:40 ` [PATCH v4 01/12] io_uring/zcrx: remove sync refill uapi David Wei
                   ` (11 more replies)
  0 siblings, 12 replies; 16+ messages in thread
From: David Wei @ 2025-11-03 23:40 UTC (permalink / raw)
  To: io-uring, netdev; +Cc: Jens Axboe, Pavel Begunkov

Each ifq is bound to a HW RX queue with no way to share this across
multiple rings. It is possible that one ring will not be able to fully
saturate an entire HW RX queue due to userspace work. There are two ways
to handle more work:

  1. Move work to other threads, but have to pay context switch overhead
     and cold caches.
  2. Add more rings with ifqs, but HW RX queues are a limited resource.

This patchset add a way for multiple rings to share the same underlying
src ifq that is bound to a HW RX queue. Rings with shared ifqs can issue
io_recvzc on zero copy sockets, just like the src ring.

Userspace are expected to create rings in separate threads and not
processes, such that all rings share the same address space. This is
because the sharing and synchronisation of refill rings is purely done
in userspace with no kernel involvement e.g. dst rings do not mmap the
refill ring. Also, userspace must distribute zero copy sockets steered
into the same HW RX queue across rings sharing the ifq.

v5:
 - remove sync refill api
 - pp mp taking ref on ifq
 - add ifq export to file
 - implement sharing by importing ifq fd

v4:
 - lock rings in seq instead of both
 - drop export io_lock_two_rings()
 - break circular ref between ifq and ring ctx
 - remove io_shutdown_zcrx_ifqs()
 - copy reg struct to user before writing ifq to ctx->zcrx_ctxs

v3:
 - drop ifq->proxy
 - use dec_and_test to clean up ifq

v2:
 - split patch

David Wei (9):
  io_uring/memmap: remove unneeded io_ring_ctx arg
  io_uring/memmap: refactor io_free_region() to take user_struct param
  io_uring/rsrc: refactor io_{un}account_mem() to take {user,mm}_struct
    param
  io_uring/zcrx: add io_zcrx_ifq arg to io_zcrx_free_area()
  io_uring/zcrx: add user_struct and mm_struct to io_zcrx_ifq
  io_uring/zcrx: move io_unregister_zcrx_ifqs() down
  io_uring/zcrx: reverse ifq refcount
  io_uring/zcrx: move io_zcrx_scrub() and dependencies up
  io_uring/zcrx: share an ifq between rings

Pavel Begunkov (3):
  io_uring/zcrx: remove sync refill uapi
  io_uring/zcrx: introduce IORING_REGISTER_ZCRX_CTRL
  io_uring/zcrx: export zcrx via a file

 include/uapi/linux/io_uring.h |  25 ++-
 io_uring/io_uring.c           |  11 +-
 io_uring/kbuf.c               |   4 +-
 io_uring/memmap.c             |  20 +--
 io_uring/memmap.h             |   2 +-
 io_uring/register.c           |  10 +-
 io_uring/rsrc.c               |  26 +--
 io_uring/rsrc.h               |   6 +-
 io_uring/zcrx.c               | 319 +++++++++++++++++++++++++---------
 io_uring/zcrx.h               |  17 +-
 10 files changed, 297 insertions(+), 143 deletions(-)

-- 
2.47.3


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-11-04 13:53 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-03 23:40 [PATCH v4 00/12] io_uring zcrx ifq sharing David Wei
2025-11-03 23:40 ` [PATCH v4 01/12] io_uring/zcrx: remove sync refill uapi David Wei
2025-11-04 13:19   ` Pavel Begunkov
2025-11-03 23:41 ` [PATCH v4 02/12] io_uring/zcrx: introduce IORING_REGISTER_ZCRX_CTRL David Wei
2025-11-03 23:41 ` [PATCH v4 03/12] io_uring/memmap: remove unneeded io_ring_ctx arg David Wei
2025-11-03 23:41 ` [PATCH v4 04/12] io_uring/memmap: refactor io_free_region() to take user_struct param David Wei
2025-11-03 23:41 ` [PATCH v4 05/12] io_uring/rsrc: refactor io_{un}account_mem() to take {user,mm}_struct param David Wei
2025-11-03 23:41 ` [PATCH v4 06/12] io_uring/zcrx: add io_zcrx_ifq arg to io_zcrx_free_area() David Wei
2025-11-03 23:41 ` [PATCH v4 07/12] io_uring/zcrx: add user_struct and mm_struct to io_zcrx_ifq David Wei
2025-11-03 23:41 ` [PATCH v4 08/12] io_uring/zcrx: move io_unregister_zcrx_ifqs() down David Wei
2025-11-03 23:41 ` [PATCH v4 09/12] io_uring/zcrx: reverse ifq refcount David Wei
2025-11-04 13:38   ` Pavel Begunkov
2025-11-03 23:41 ` [PATCH v4 10/12] io_uring/zcrx: move io_zcrx_scrub() and dependencies up David Wei
2025-11-03 23:41 ` [PATCH v4 11/12] io_uring/zcrx: export zcrx via a file David Wei
2025-11-03 23:41 ` [PATCH v4 12/12] io_uring/zcrx: share an ifq between rings David Wei
2025-11-04 13:53   ` Pavel Begunkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox