Skip to main content

Module ring

Module ring 

Source
Expand description

Ring buffer for async I/O submission and completion.

Each ring consists of two pages mapped into the owning process’s address space: a Submission Queue (SQ) page and a Completion Queue (CQ) page. The kernel tracks metadata (head/tail pointers, ownership) internally; only the raw SQE/CQE arrays are visible to userspace.

Re-exportsΒ§

use crate::memory; πŸ”’
use crate::memory::address_space::VmaFlags; πŸ”’
use crate::memory::address_space::VmaPageSize; πŸ”’
use crate::memory::address_space::VmaType; πŸ”’
use crate::memory::phys_to_virt; πŸ”’
use crate::memory::PhysFrame; πŸ”’
use crate::sync::SpinLock; πŸ”’
use alloc::sync::Arc; πŸ”’
use alloc::vec::Vec; πŸ”’
use core::sync::atomic::AtomicU32; πŸ”’
use core::sync::atomic::AtomicU64; πŸ”’
use core::sync::atomic::Ordering; πŸ”’
use super::ops::AsyncCqe; πŸ”’
use super::ops::AsyncSqe; πŸ”’
use super::ops::DEFAULT_RING_ENTRIES; πŸ”’

StructsΒ§

Ring
A shared submission/completion ring for a single process.
RingMeta πŸ”’
Metadata header embedded at offset 0 of each ring page. The SQE/CQE array starts at RING_META_SIZE bytes from the page base.

EnumsΒ§

RingError

ConstantsΒ§

MAX_RINGS πŸ”’
RING_META_SIZE πŸ”’

StaticsΒ§

NEXT_RING_ID πŸ”’
RING_REGISTRY πŸ”’

FunctionsΒ§

destroy_ring
Remove a ring from the registry and free its pages.
find_ring
Find a ring by its opaque id.
next_ring_id πŸ”’