Struct io_uring::Parameters

source ·
pub struct Parameters(/* private fields */);
Expand description

The parameters that were used to construct an IoUring.

Implementations§

source§

impl Parameters

source

pub fn is_setup_sqpoll(&self) -> bool

Whether a kernel thread is performing queue polling. Enabled with Builder::setup_sqpoll.

source

pub fn is_setup_iopoll(&self) -> bool

Whether waiting for completion events is done with a busy loop instead of using IRQs. Enabled with Builder::setup_iopoll.

source

pub fn is_setup_single_issuer(&self) -> bool

Whether the single issuer hint is enabled. Enabled with Builder::setup_single_issuer.

source

pub fn is_feature_single_mmap(&self) -> bool

If this flag is set, the SQ and CQ rings were mapped with a single mmap(2) call. This means that only two syscalls were used instead of three.

source

pub fn is_feature_nodrop(&self) -> bool

If this flag is set, io_uring supports never dropping completion events. If a completion event occurs and the CQ ring is full, the kernel stores the event internally until such a time that the CQ ring has room for more entries.

source

pub fn is_feature_submit_stable(&self) -> bool

If this flag is set, applications can be certain that any data for async offload has been consumed when the kernel has consumed the SQE.

source

pub fn is_feature_rw_cur_pos(&self) -> bool

If this flag is set, applications can specify offset == -1 with Readv, Writev, ReadFixed, WriteFixed, Read and Write, which behaves exactly like setting offset == -1 in preadv2(2) and pwritev2(2): it’ll use (and update) the current file position.

This obviously comes with the caveat that if the application has multiple reads or writes in flight, then the end result will not be as expected. This is similar to threads sharing a file descriptor and doing IO using the current file position.

source

pub fn is_feature_cur_personality(&self) -> bool

If this flag is set, then io_uring guarantees that both sync and async execution of a request assumes the credentials of the task that called Submitter::enter to queue the requests. If this flag isn’t set, then requests are issued with the credentials of the task that originally registered the io_uring. If only one task is using a ring, then this flag doesn’t matter as the credentials will always be the same.

Note that this is the default behavior, tasks can still register different personalities through Submitter::register_personality.

source

pub fn is_feature_fast_poll(&self) -> bool

Whether async pollable I/O is fast.

See the commit message that introduced it for more details.

If this flag is set, then io_uring supports using an internal poll mechanism to drive data/space readiness. This means that requests that cannot read or write data to a file no longer need to be punted to an async thread for handling, instead they will begin operation when the file is ready. This is similar to doing poll + read/write in userspace, but eliminates the need to do so. If this flag is set, requests waiting on space/data consume a lot less resources doing so as they are not blocking a thread. Available since kernel 5.7.

source

pub fn is_feature_poll_32bits(&self) -> bool

Whether poll events are stored using 32 bits instead of 16. This allows the user to use EPOLLEXCLUSIVE.

If this flag is set, the IORING_OP_POLL_ADD command accepts the full 32-bit range of epoll based flags. Most notably EPOLLEXCLUSIVE which allows exclusive (waking single waiters) behavior. Available since kernel 5.9.

source

pub fn is_feature_sqpoll_nonfixed(&self) -> bool

If this flag is set, the IORING_SETUP_SQPOLL feature no longer requires the use of fixed files. Any normal file descriptor can be used for IO commands without needing registration. Available since kernel 5.11.

source

pub fn is_feature_ext_arg(&self) -> bool

If this flag is set, then the io_uring_enter(2) system call supports passing in an extended argument instead of just the sigset_t of earlier kernels. This extended argument is of type struct io_uring_getevents_arg and allows the caller to pass in both a sigset_t and a timeout argument for waiting on events. The struct layout is as follows:

// struct io_uring_getevents_arg { // __u64 sigmask; // __u32 sigmask_sz; // __u32 pad; // __u64 ts; // };

and a pointer to this struct must be passed in if IORING_ENTER_EXT_ARG is set in the flags for the enter system call. Available since kernel 5.11.

source

pub fn is_feature_native_workers(&self) -> bool

If this flag is set, io_uring is using native workers for its async helpers. Previous kernels used kernel threads that assumed the identity of the original io_uring owning task, but later kernels will actively create what looks more like regular process threads instead. Available since kernel 5.12.

source

pub fn is_feature_resource_tagging(&self) -> bool

Whether the kernel supports tagging resources.

If this flag is set, then io_uring supports a variety of features related to fixed files and buffers. In particular, it indicates that registered buffers can be updated in-place, whereas before the full set would have to be unregistered first. Available since kernel 5.13.

source

pub fn is_feature_skip_cqe_on_success(&self) -> bool

Whether the kernel supports IOSQE_CQE_SKIP_SUCCESS.

This feature allows skipping the generation of a CQE if a SQE executes normally. Available since kernel 5.17.

source

pub fn is_feature_linked_file(&self) -> bool

Whether the kernel supports deferred file assignment.

If this flag is set, then io_uring supports sane assignment of files for SQEs that have dependencies. For example, if a chain of SQEs are submitted with IOSQE_IO_LINK, then kernels without this flag will prepare the file for each link upfront. If a previous link opens a file with a known index, eg if direct descriptors are used with open or accept, then file assignment needs to happen post execution of that SQE. If this flag is set, then the kernel will defer file assignment until execution of a given request is started. Available since kernel 5.17.

source

pub fn sq_entries(&self) -> u32

The number of submission queue entries allocated.

source

pub fn cq_entries(&self) -> u32

The number of completion queue entries allocated.

Trait Implementations§

source§

impl Clone for Parameters

source§

fn clone(&self) -> Parameters

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Parameters

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.