-
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
revise network integration and add support of futures #117
Conversation
the new interface is required for hermit-os/hermit-rs#117
I am not sure if I understand this approach correctly. How is the polling interface exposed to the user? All newly introduced As far as I understand it, we would want to expose an API for polling on sockets like epoll, kqueue, event ports and wepoll. Such an API is not part of Am I missing something? What do you think? |
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.
In general this looks good to me.
Regarding the wrongly ordered packages we talked about: With this PR I get a few “TCP Previous segment not captured” and “TCP ACKed unseen segment” in Wireshark. Are these the same symptoms you meant? They are but an artifact of Wireshark not being able to keep up. My symptoms vanished when I set my CPU governor to performance
and gave the Wireshark process a higher priority. Conversely, I could produce these symptoms without this PR by lowering the priority of the Wireshark process. I am not sure though, if this is caused by the additional CPU usage by the executor of if this is avoidable, and we do something wrong.
I'll have a deeper look into the implementation and will create PRs with suggestions for simplification to your branch.
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.
Our executor is never actually run, so network_run
is currently dead code. I'll have a look at this.
Edit: Instead, network_poll
is called manually in the block_on
loop.
the new interface is required for hermit-os/hermit-rs#117
the new interface is required for hermit-os/hermit-rs#117
@mkroening I merge the current master to this PR. I am not sure, if I merge everything correctly. Can you check it? |
the new interface is required for hermit-os/hermit-rs#117
the new interface is required for hermit-os/hermit-rs#117
the new interface is required for hermit-os/hermit-rs#117
the new interface is required for hermit-os/hermit-rs#117
the new interface is required for hermit-os/hermit-rs#117
smoltcp 0.7 provides async/await waker support (smoltcp-rs/smoltcp#394). I followed the example implementation https://github.com/embassy-rs/embassy/tree/net/embassy-net to add waker support in hermit-sys. However, hermit-sys can be used in a multi-threaded applications. Consequently, the implementation must be thread safed. In addition, we still have an "network thread", which is wakeup by an interrupt. The thread wakeups all waiting future. If no future is available, the thread calls directly the IP stack.
smoltcp 0.7 provides async/await waker support (smoltcp-rs/smoltcp#394). I followed the example implementation https://github.com/embassy-rs/embassy/tree/net/embassy-net to add waker support in hermit-sys. However, hermit-sys can be used in a multi-threaded applications. Consequently, the implementation must be thread safed. In addition, we still have an "network thread", which is wakeup by an interrupt. The thread wakeups all waiting future. If no future is available, the thread calls directly the IP stack.
- the kernel uses the C calling convention and requires minor changes
the new interface is required for hermit-os/hermit-rs#117
the new interface is required for hermit-os/hermit-rs#117
- workaround is required for Windows - it seems that the latest Qemu version doesn't work correctly on Windows
smoltcp 0.7 provides async/await waker support (smoltcp-rs/smoltcp#394).
I followed the example implementation https://github.com/embassy-rs/embassy/tree/net/embassy-net
to add waker support in hermit-sys.
However, hermit-sys can be used in a multi-threaded applications.
Consequently, the implementation must be thread safed. In addition,
we still have an "network thread", which is wakeup by an interrupt.
The thread wakeups all waiting future. If no future is available,
the thread calls directly the IP stack.