Skip to content

feat(driver,net)!: more nonempty#906

Open
Berrysoft wants to merge 8 commits intocompio-rs:masterfrom
Berrysoft:more-nonempty
Open

feat(driver,net)!: more nonempty#906
Berrysoft wants to merge 8 commits intocompio-rs:masterfrom
Berrysoft:more-nonempty

Conversation

@Berrysoft
Copy link
Copy Markdown
Member

A new trait PollFirst is added to make compio-net simpler.

Also add poll_first for Accept.

@Berrysoft Berrysoft requested a review from Copilot May 4, 2026 09:44
@Berrysoft Berrysoft self-assigned this May 4, 2026
@Berrysoft Berrysoft added this to the v0.19 milestone May 4, 2026
@Berrysoft Berrysoft added package: net Related to compio-net package: driver Related to compio-driver labels May 4, 2026
@github-actions github-actions Bot added breaking change enhancement New feature or request labels May 4, 2026
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 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 PollFirst trait in compio-driver and migrate receive/managed socket ops from inherent poll_first() methods to trait impls.
  • Extend io-uring poll-first support to Accept, including Linux kernel gating and listener-side state tracking in compio-net.
  • Replace the non-Linux inline socket-state stub with a dedicated stub.rs module 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.

Comment thread compio-net/src/socket/stub.rs
Comment thread compio-net/src/socket/linux.rs
Comment thread compio-driver/src/sys/op/socket/mod.rs Outdated
Comment thread compio-net/src/socket/mod.rs
@abh1nav10
Copy link
Copy Markdown
Contributor

The try_update and update APIs landed in the standard library in 1.95. Maybe we can add it to synchrony, make a minor version bump, and then use it here as well, since fetch_update is getting deprecated in 1.99.
Happy to make a PR to synchrony!

@Berrysoft
Copy link
Copy Markdown
Member Author

PRs are welcome :) , for synchrony.

@AsakuraMizu
Copy link
Copy Markdown
Collaborator

The try_update and update APIs landed in the standard library in 1.95.

@Berrysoft I want to ask that question again: Do we have a MSRV?

@Berrysoft
Copy link
Copy Markdown
Member Author

Do we have a MSRV?

Again, no.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change enhancement New feature or request package: driver Related to compio-driver package: net Related to compio-net

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants