Skip to content

feat(driver,iour): detect multishot support#837

Closed
Berrysoft wants to merge 3 commits intocompio-rs:masterfrom
Berrysoft:dev/detect-multishot
Closed

feat(driver,iour): detect multishot support#837
Berrysoft wants to merge 3 commits intocompio-rs:masterfrom
Berrysoft:dev/detect-multishot

Conversation

@Berrysoft
Copy link
Copy Markdown
Member

Close #831

I hope the code is robust enough...

@Berrysoft Berrysoft added the driver: io-uring About the io-uring driver label Apr 5, 2026
@Berrysoft Berrysoft self-assigned this Apr 5, 2026
@Berrysoft Berrysoft requested a review from Copilot April 5, 2026 09:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds runtime detection for io-uring “multishot” support (e.g., RecvMulti, AcceptMulti) so the driver can decide whether to submit a multishot SQE or fall back to a non-multishot operation, addressing #831 (“no public API to probe if io-uring supports RecvMulti”).

Changes:

  • Introduces sys/iour/multishot.rs with probing logic and a detect() helper to classify SQEs as multishot-supported/unsupported.
  • Updates the io-uring driver submission path to use is_entry_supported() (multishot-aware) instead of opcode-only probing.
  • Refactors BufControl to expose new_inner/release_inner APIs that operate on an io_uring::Submitter (enabling probing code to register a buf ring without a full Driver).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
compio-driver/src/sys/iour/multishot.rs Adds runtime probing + SQE inspection to infer multishot support.
compio-driver/src/sys/iour/mod.rs Routes SQE support checks through multishot-aware detection before falling back.
compio-driver/src/sys/iour/buffer_pool.rs Allows buf-ring register/unregister using a Submitter directly (for probes).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread compio-driver/src/sys/iour/multishot.rs
Comment thread compio-driver/src/sys/iour/multishot.rs
Comment thread compio-driver/src/sys/iour/multishot.rs
Comment thread compio-driver/src/sys/iour/multishot.rs
Comment thread compio-driver/src/sys/iour/multishot.rs
@George-Miao
Copy link
Copy Markdown
Member

George-Miao commented Apr 9, 2026

This is some non-trivial task to do. I really think this detection should be an optional feature instead of default behavior... And if user choose not to detect, just let it fail.

One other possibility I can think of is instead of detecting it in driver, move the logic to net: keep a global AtomicBool "not_supported" for each op, and when user calls corresponding op, if not_supported is true, use fallback op, otherwise perform the op and check results, if it's an Unsupported error, flip the flag and fallback; otherwise return.

@Berrysoft
Copy link
Copy Markdown
Member Author

Too complex to move the code to compio-net. Let's just add docs about it.

@Berrysoft Berrysoft closed this Apr 13, 2026
@Berrysoft Berrysoft deleted the dev/detect-multishot branch May 3, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

driver: io-uring About the io-uring driver

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No public API to probe if the io-uring supports RecvMulti

3 participants