Add support for mixed sized CQEs
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest8 patches 7 repliesIn review
- v1 RFC8 patches 0 repliesSuperseded
Changes in v2 from the cover letter
- Various little cleanups
- Rebase on for-6.18/io_uring
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | io_uring: remove io_ctx_cqe32() helperinclude/ include/ | +2 | 0 replies | |
| 2/8 | io_uring: add UAPI definitions for mixed CQE postingsinclude/ | +10 | 0 replies | |
| 3/8 | io_uring/fdinfo: handle mixed sized CQEsio_uring/ | +12 | 0 replies | |
| 4/8 | io_uring/trace: support completion tracing of mixed 32b CQEsinclude/ | +2 | 0 replies | |
| 5/8 | io_uring: add support for IORING_SETUP_CQE_MIXEDinclude/ io_uring/ io_uring/ +1 more | +105 | 0 replies | |
| 6/8 | io_uring/nop: add support for IORING_SETUP_CQE_MIXEDinclude/ io_uring/ | +16 | 0 replies | |
| 7/8 | io_uring/uring_cmd: add support for IORING_SETUP_CQE_MIXEDio_uring/ io_uring/ | +3 | 0 replies | |
| 8/8 | io_uring/zcrx: add support for IORING_SETUP_CQE_MIXEDDocumentation/ io_uring/ | +4 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCHSET v2 0/8] Add support for mixed sized CQEs
Hi,
Currently io_uring supports two modes for CQEs:
1) The standard mode, where 16b CQEs are used
2) Setting IORING_SETUP_CQE32, which makes all CQEs posted 32b
Certain features need to pass more information back than just a single 32-bit res field, and hence mandate the use of CQE32 to be able to work. Examples of that include passthrough or other uses of ->uring_cmd() like socket option getting and setting, including timestamps.
This patchset adds support for IORING_SETUP_CQE_MIXED, which allows posting both 16b and 32b CQEs on the same CQ ring. The idea here is that we need not waste twice the space for CQ rings, or use twice the space per CQE posted, if only some of the CQEs posted require the use of 32b CQEs. On a ring setup in CQE mixed mode, 32b posted CQEs will have IORING_CQE_F_32 set in cqe->flags to tell the application (or liburing) about this fact.
This is mostly trivial to support, with the corner case being attempting to post a 32b CQE when the ring is a single 16b CQE away from wrapping. As CQEs must be contigious in memory, that's simply not possible. The solution taken by this patchset is to add a special CQE type, which has IORING_CQE_F_SKIP set. This is a pad/nop CQE, which should simply be ignored, as it carries no information and serves no other purpose than to re-align the posted CQEs for ring wrap.
If used with liburing, then both the 32b vs 16b postings and the skip are transparent.
liburing support and a few basic test cases can be found here:
https://git.kernel.org/pub/scm/linux/kernel/git/axboe/liburing.git/log/?h=cqe-mixed
including man page updates for the newly added setup and CQE flags, and the patches posted here can also be found at:
https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/log/?h=io_uring-cqe-mix
Patch 1 is just a prep patch, and patch 2 adds the cqe flags so that the core can be adapted before support is actually there. Patches 3 and 4 are exactly that, and patch 5 finally adds support for the mixed mode. Patch 6 adds support for NOP testing of this, and patches 7/8 allow IORING_SETUP_CQE_MIXED for uring_cmd/zcrx which previously required IORING_SETUP_CQE32 to work.
Documentation/networking/iou-zcrx.rst | 2 +- include/linux/io_uring_types.h | 6 --- include/trace/events/io_uring.h | 4 +- include/uapi/linux/io_uring.h | 17 ++++++ io_uring/cmd_net.c | 3 +- io_uring/fdinfo.c | 22 ++++---- io_uring/io_uring.c | 78 +++++++++++++++++++++------ io_uring/io_uring.h | 49 ++++++++++++----- io_uring/nop.c | 17 +++++- io_uring/register.c | 3 +- io_uring/uring_cmd.c | 2 +- io_uring/zcrx.c | 5 +- 12 files changed, 152 insertions(+), 56 deletions(-)
Changes since v1:
- Various little cleanups
- Rebase on for-6.18/io_uring
Signature · 1 line
Jens Axboe