forked from tokio-rs/tokio-uring
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Uring cmd #2
Draft
ollie-etl
wants to merge
29
commits into
master
Choose a base branch
from
uring_cmd_temp
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Uring cmd #2
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
94e49a2
Add sqe128, cqe32, and uring-cmd features
e9d8810
Merge branch 'master' into entry128
thomasbarrett 43fc143
Remove uring-cmd feature
a4b2576
Merge branch 'entry128' of github.com:thomasbarrett/tokio-uring into …
6125abb
Only run uring_cmd16 test if opcode::UringCmd16 is supported on test …
a6b3a8d
Merge branch 'tokio-rs:master' into entry128
thomasbarrett 805a265
Fix formatting in tests
52b29de
Box libc::msghdr in SendMesgZc
ollie-etl 3b0d245
Merge branch 'master' into bug-unstable-msghdr
ollie-etl 0d24217
Remove check on shrinking in set_init
ollie-etl d425b17
Merge remote-tracking branch 'origin/bug-unstable-msghdr' into bug-un…
ollie-etl e65d8fe
Merge branch 'tokio-rs:master' into bug-unstable-msghdr
ollie-etl dc8990d
Merge remote-tracking branch 'origin/bug-unstable-msghdr' into bug-un…
ollie-etl 948772a
Make tolerent to unexpected error
ollie-etl 0e99bb0
Trace flags
ollie-etl 5799f1a
Add logging
ollie-etl 7efa8cc
Better debug
ollie-etl b1ad8ea
Remove trace
ollie-etl 36f124b
Add builder support for setting worker queues
ollie-etl c5eaa84
Update io-uring dep
ollie-etl 7abf120
Merge remote-tracking branch 'io_uring_pr/entry128' into uring_cmd
MA-ETL ce6f758
Merge remote-tracking branch 'etl/etl-dev' into uring_cmd_dev
MA-ETL e5c17c4
Update for io-uring 0.6.0 crate.
MA-ETL 8fc2f7b
Fix submit_op_2
MA-ETL 6c9a473
Update
MA-ETL 493a9a4
Update
MA-ETL 15b325b
Update
MA-ETL 243096d
Update
MA-ETL 600bf97
Mark api as unsafe, and provide a metadata store
ollie-etl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,3 +56,5 @@ mod writev; | |
|
||
mod writev_all; | ||
pub(crate) use writev_all::writev_at_all; | ||
|
||
mod uring_cmd; |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
use crate::io::SharedFd; | ||
use crate::runtime::driver::op::{Completable, CqeResult, Op}; | ||
use crate::runtime::CONTEXT; | ||
use std::io; | ||
|
||
pub(crate) struct UringCmd16 { | ||
/// Holds a strong ref to the FD, preventing the file from being closed | ||
/// while the operation is in-flight. | ||
#[allow(dead_code)] | ||
fd: SharedFd, | ||
} | ||
|
||
impl Op<UringCmd16> { | ||
/// A file/device-specific 16-byte command, akin (but not equivalent) to ioctl | ||
pub(crate) fn uring_cmd16( | ||
fd: &SharedFd, | ||
cmd_op: u32, | ||
cmd: [u8; 16], | ||
) -> io::Result<Op<UringCmd16>> { | ||
use io_uring::{opcode, types}; | ||
|
||
CONTEXT.with(|x| { | ||
x.handle().expect("Not in a runtime context").submit_op( | ||
UringCmd16 { fd: fd.clone() }, | ||
|_| { | ||
opcode::UringCmd16::new(types::Fd(fd.raw_fd()), cmd_op) | ||
.cmd(cmd) | ||
.build() | ||
}, | ||
) | ||
}) | ||
} | ||
} | ||
|
||
impl Completable for UringCmd16 { | ||
type Output = io::Result<u32>; | ||
|
||
fn complete(self, cqe: CqeResult) -> Self::Output { | ||
cqe.result | ||
} | ||
} | ||
|
||
#[cfg(feature = "sqe128")] | ||
pub(crate) struct UringCmd80 { | ||
/// Holds a strong ref to the FD, preventing the file from being closed | ||
/// while the operation is in-flight. | ||
#[allow(dead_code)] | ||
fd: SharedFd, | ||
} | ||
|
||
#[cfg(feature = "sqe128")] | ||
impl Op<UringCmd80> { | ||
/// A file/device-specific 80-byte command, akin (but not equivalent) to ioctl | ||
pub(crate) fn uring_cmd80( | ||
fd: &SharedFd, | ||
cmd_op: u32, | ||
cmd: [u8; 80], | ||
) -> io::Result<Op<UringCmd80>> { | ||
use io_uring::{opcode, types}; | ||
|
||
CONTEXT.with(|x| { | ||
x.handle().expect("Not in a runtime context").submit_op( | ||
UringCmd80 { fd: fd.clone() }, | ||
|_| { | ||
opcode::UringCmd80::new(types::Fd(fd.raw_fd()), cmd_op) | ||
.cmd(cmd) | ||
.build() | ||
}, | ||
) | ||
}) | ||
} | ||
} | ||
|
||
#[cfg(feature = "sqe128")] | ||
impl Completable for UringCmd80 { | ||
type Output = io::Result<u32>; | ||
|
||
fn complete(self, cqe: CqeResult) -> Self::Output { | ||
cqe.result | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
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.