pub struct Config<'r> { /* private fields */ }Expand description
Configuration of a Ring.
Created by calling Ring::config.
Implementations§
source§impl<'r> Config<'r>
impl<'r> Config<'r>
sourcepub const fn with_completion_queue_size(self, entries: u32) -> Self
pub const fn with_completion_queue_size(self, entries: u32) -> Self
Set the size of the completion queue.
By default the kernel will use a completion queue twice as large as the
submission queue (entries in the call to Ring::config).
Uses IORING_SETUP_CQSIZE, added in Linux kernel 5.5.
sourcepub const fn clamp_queue_sizes(self) -> Self
pub const fn clamp_queue_sizes(self) -> Self
Clamp queue sizes to the maximum.
The maximum queue sizes aren’t exposed by the kernel, making this the only way (currently) to get the largest possible queues.
Uses IORING_SETUP_CLAMP, added in Linux kernel 5.6.
sourcepub const fn with_kernel_thread(self, enabled: bool) -> Self
pub const fn with_kernel_thread(self, enabled: bool) -> Self
Start a kernel thread polling the Ring.
When this option is enabled a kernel thread is created to perform submission queue polling. This allows issuing I/O without ever context switching into the kernel.
§Notes
When setting this to false it significantly changes the way A10 works.
With this disabled you need to call Ring::poll to submit I/O work,
with this enables this is done by the kernel thread. That means that if
multiple threads use the same SubmissionQueue their submissions
might not actually be submitted until Ring::poll is called.
sourcepub const fn with_cpu_affinity(self, cpu: u32) -> Self
pub const fn with_cpu_affinity(self, cpu: u32) -> Self
Set the CPU affinity of kernel thread polling the Ring.
Only works in combination with Config::with_kernel_thread.
sourcepub const fn with_idle_timeout(self, timeout: Duration) -> Self
pub const fn with_idle_timeout(self, timeout: Duration) -> Self
Set the idle timeout of the kernel thread polling the submission queue.
After timeout time has passed after the last I/O submission the kernel
thread will go to sleep. If the I/O is kept busy the kernel thread will
never sleep. Note that A10 will ensure the kernel thread is woken up
when more submissions are added.
The accuracy of timeout is only in milliseconds, anything more precise
will be discarded.
sourcepub const fn attach(self, other_ring: &'r Ring) -> Self
pub const fn attach(self, other_ring: &'r Ring) -> Self
Attach the new (to be created) ring to other_ring.
This will cause the Ring being created to share the asynchronous
worker thread backend of the specified other_ring, rather than create
a new separate thread pool.
Uses IORING_SETUP_ATTACH_WQ, added in Linux kernel 5.6.
sourcepub const fn attach_queue(self, other_ring: &'r SubmissionQueue) -> Self
pub const fn attach_queue(self, other_ring: &'r SubmissionQueue) -> Self
Same as Config::attach, but accepts a SubmissionQueue.