feat(driver): multishot op#715
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request implements multishot opcode support for io_uring operations, addressing issue #104. Multishot operations allow a single submission to generate multiple completion events, which is useful for operations like reading multiple buffers or receiving multiple network packets without resubmitting the operation each time.
Changes:
- Adds three new multishot operations:
ReadMultiAt,ReadMulti, andRecvMultithat can produce multiple completion results from a single submission - Implements a fallback mechanism via
create_entry_fallback()to gracefully handle unsupported opcodes by falling back to single-shot operations - Introduces
pop_multishot()API to retrieve intermediate results from multishot operations before the final completion
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| compio-driver/tests/file.rs | Adds test cases for multishot read and recv operations, including new test helper push_and_wait_multi |
| compio-driver/src/sys/stub/mod.rs | Provides stub implementation of pop_multishot returning None |
| compio-driver/src/sys/poll/mod.rs | Provides polling driver implementation of pop_multishot returning None (no multishot support) |
| compio-driver/src/sys/iour/op.rs | Implements the three new multishot operation types with fallback to single-shot managed operations, and refactors code with take_buffer helper |
| compio-driver/src/sys/iour/mod.rs | Core multishot support including result queue management, completion handling with more flag detection, and fallback logic |
| compio-driver/src/sys/iocp/mod.rs | Provides IOCP driver stub for pop_multishot returning None |
| compio-driver/src/sys/fusion/op.rs | Adds macro invocations for the three multishot operations in fusion driver |
| compio-driver/src/sys/fusion/mod.rs | Delegates pop_multishot calls to underlying driver and exports take_buffer helper |
| compio-driver/src/op.rs | Exports new multishot operations and implements ResultTakeBuffer for BufResult<usize, Extra> to support buffer extraction |
| compio-driver/src/lib.rs | Adds public pop_multishot method to Proactor API |
| compio-driver/src/key.rs | Adds wake_by_ref method to FrozenKey for waking tasks without consuming the key |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Oh, no. #716 only handles ReadMulti, but cannot handle SendMulti or AcceptMulti, as the opcode are the same for oneshot/multishot ops. There's no way to probe. |
d18f270 to
7dd2a07
Compare
1bdf588 to
5310f37
Compare
9d42c2c to
8d82135
Compare
| need_push_notifier: bool, | ||
| multishot_results: BTreeMap<usize, VecDeque<CEntry>>, | ||
| _local_marker: PhantomData<ErasedKey>, | ||
| multishot_results: HashMap<ErasedKey, VecDeque<CEntry>>, |
There was a problem hiding this comment.
We can implement Ord for ErasedKey if you prefer BTreeMap.
Related: #104