Allow overriding the kernel version check for recv multishot
- Dominant language
- Rust
- Stars
- 1.9k
- Forks
- 133
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 20
Description
Compio enables `RecvMulti` and `RecvMsgMulti` only when the reported kernel version is at least 6.0:
https://github.com/compio-rs/compio/blob/9721017467cb18edbc58ff11299e321738962a20/compio-driver/src/sys/op/managed/iour.rs#L580-L591
This does not work correctly on distribution kernels with backported io_uring features.
For example, CentOS Stream 9 kernel `5.14.0-710.el9.x86_64` contains recv and recvmsg multishot support:
https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/blob/kernel-5.14.0-710.el9/io_uring/net.c#L798-840
A functional test confirmed that a single multishot SQE produces multiple successful CQEs with both `IORING_CQE_F_MORE` and `IORING_CQE_F_BUFFER`. However, Compio sees the `5.14` release string and always selects the one-shot fallback.
The existing `io_uring::Probe` cannot detect this capability because it only reports opcode support. Multishot recv uses the existing `IORING_OP_RECV` or `IORING_OP_RECVMSG` opcode with `IORING_RECV_MULTISHOT` in `sqe.ioprio`.
My suggestion is to provide an official runtime option to force `RecvMulti` and `RecvMsgMulti`, bypassing the kernel version check. The default behavior can remain unchanged, while users who know their kernel includes the backport can explicitly enable multishot.
This would solve the issue without requiring a complex functional probe. Would such an override be acceptable to the project?
Contributor guide
Research direction
Start in compio-driver/src/sys/op/managed/iour.rs at the kernel version check for RecvMulti and RecvMsgMulti, and review how io_uring::Probe is used there. Define an official runtime override for kernels with backported multishot support while preserving the current default and one-shot fallback; verify behavior with the functional multishot test described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100