epoll to mio migration#362
Open
eric-14 wants to merge 7 commits into
Open
Conversation
When register_event we pass in the value of u32/u64, so we don't need to convert it to u16 and then pass it to handle_event. Signed-off-by: Wenyu Huang <huangwenyuu@outlook.com>
We can safely use usize instead of u64, because normally we will not register a data that exceeds the size of usize Signed-off-by: Wenyu Huang <huangwenyuu@outlook.com>
Epoll is linux-specific. So we use mio, which is a cross-platform event notification, to replace Epoll. Signed-off-by: Wenyu Huang <huangwenyuu@outlook.com>
change the logging od undefined events in vring are logged using `println!` to `log::warn!`. Signed-off-by: EricMwangi <ericmwas01@gmail.com>
Rename the generic third paremeter in un/register_listener to `queue_idx`. This explicitly describes the function of the parameter. Signed-off-by: EricMwangi <ericmwas01@gmail.com>
Add is_error,is_read_closed and is_write_closed to exhaust states of event. This provides better clarity into the state of events. Signed-off-by: EricMwangi <ericmwas01@gmail.com>
Modify `VringPollHandler` to pass `&mut Poll` to `run`, removing the need for a Mutex wrapper around Poller. This simplifies compliance with the `Send` + `Sync` requirements of `VringPollHandler` and removes false implications of multithreaded safety. Signed-off-by: EricMwangi <ericmwas01@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the PR
Epoll is linux specific. To support unix systems this PR changes I/O support to mio.
PR is also a continuation of #316.
The PR completes the work needed to move from epoll to mio.
Requirements
Before submitting your PR, please make sure you addressed the following
requirements:
[ x ] All commits in this PR have Signed-Off-By trailers (with
git commit -s), and the commit message has max 60 characters for the
summary and max 75 characters for each description line.
[ x ] All added/changed functionality has a corresponding unit/integration
test.
[ x ] All added/changed public-facing functionality has entries in the "Upcoming
Release" section of CHANGELOG.md (if no such section exists, please create one).
[ x ] Any newly added unsafe code is properly documented.