feat(driver,net)!: more nonempty#906
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors socket non-empty/poll-first handling so compio-net can work against a new compio_driver::PollFirst trait, and extends the optimization to Accept on Linux/io-uring. It mainly centralizes poll-first state handling in compio-net while wiring the new trait through driver socket operations.
Changes:
- Add a new public
PollFirsttrait incompio-driverand migrate receive/managed socket ops from inherentpoll_first()methods to trait impls. - Extend io-uring poll-first support to
Accept, including Linux kernel gating and listener-side state tracking incompio-net. - Replace the non-Linux inline socket-state stub with a dedicated
stub.rsmodule and split Linux socket state into separate recv/accept tracking.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
compio-net/src/socket/stub.rs |
Adds the non-Linux no-op SocketState stub used outside Linux. |
compio-net/src/socket/mod.rs |
Refactors socket recv/accept paths to use trait-based poll-first hooks and accept-side extra state. |
compio-net/src/socket/linux.rs |
Reworks Linux socket state into packed recv/accept non-empty tracking with poll-first helpers. |
compio-driver/src/sys/pal/iour/mod.rs |
Extends poll-first SQE flag gating so Accept uses a newer kernel threshold. |
compio-driver/src/sys/op/socket/unix.rs |
Adds poll-first state to Unix Accept and implements the new trait. |
compio-driver/src/sys/op/socket/mod.rs |
Replaces inherent poll_first() methods on socket receive ops with PollFirst trait impls. |
compio-driver/src/sys/op/socket/iour.rs |
Applies poll-first SQE flag handling to io-uring Accept. |
compio-driver/src/sys/op/managed/iour.rs |
Converts managed io-uring recv ops to the shared PollFirst trait. |
compio-driver/src/sys/op/managed/fusion.rs |
Forwards PollFirst through fused managed recv ops. |
compio-driver/src/sys/op/managed/fallback.rs |
Forwards PollFirst through fallback managed recv ops. |
compio-driver/src/sys/driver/mod.rs |
Introduces the new public PollFirst trait. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The |
|
PRs are welcome :) , for synchrony. |
@Berrysoft I want to ask that question again: Do we have a MSRV? |
Again, no. |
A new trait
PollFirstis added to make compio-net simpler.Also add
poll_firstforAccept.