-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add BSD socket layer #633
add BSD socket layer #633
Conversation
@mkroening A network interrupt has to wakeup all async tasks to check their tasks. Currently, I use a BtreeMap to store all blocked async tasks. The interrupts clears the map and wakeup all tasks. Do you have an better idea? |
to realize a BSD socket layer, the executor has to return dirctly UNIX-like error number because the layer depends on a C interface and doesn't support Rust's error handling
becaue we didn't know, which task is waiting for the network interface
- move __sys_recv to the module socket
the implementation is derived from https://github.com/cmnord/pflock/tree/cnord/loom
RX packet are directly copied from the network interfaces to temporary vector. The ring buffers from the network interface must be cleared as soon as possible.
- stay in polling mode - trigger a periodic timer to check, if the NIC is used - if not, the polling mode will be disabled
- disable polling mode only if all tasks want to leave the polling mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. 👍
I also opened two PRs regarding RwLock
s:
They don't block this PR though. We can decide between them later.
bors try |
tryBuild succeeded: |
388: add BSD socket layer r=stlankes a=stlankes The new BSD socket layer depends on hermit-os/kernel#633 and a revised version of `std`. `std` is part of the [rust](/hermitcore/rust/tree/socket) fork. Note: If you use this version, please modify `Cargo.toml`. [`hermit-abi`](https://github.com/hermitcore/rust/blob/socket/library/std/Cargo.toml#L45) must point to the version of this PR. Co-authored-by: Stefan Lankes <slankes@eonerc.rwth-aachen.de>
388: add BSD socket layer r=stlankes a=stlankes The new BSD socket layer depends on hermit-os/kernel#633 and a revised version of `std`. `std` is part of the [rust](/hermitcore/rust/tree/socket) fork. Note: If you use this version, please modify `Cargo.toml`. [`hermit-abi`](https://github.com/hermitcore/rust/blob/socket/library/std/Cargo.toml#L45) must point to the version of this PR. Co-authored-by: Stefan Lankes <slankes@eonerc.rwth-aachen.de>
This PR realize a classical BSD socket layer. To realize a BSD socket layer, the executor has to return directly UNIX-like error number because the layer depends on a C interface and doesn't support Rust's error handling.