Skip to main content

SplitQueue

Struct SplitQueue 

Source
pub struct SplitQueue { /* private fields */ }
Expand description

Single-owner, bounded split-virtqueue reference model.

Configuration preallocates descriptor, available, used, and ownership tables. Publication, consumption, completion, notification control, and reset perform no allocation or payload copy.

Implementations§

Source§

impl SplitQueue

Source

pub fn new( max_size: QueueSize, max_chain_descriptors: u16, ) -> Result<Self, SplitQueueInitError>

Construct an unconfigured queue.

Source

pub const fn max_chain_descriptors(&self) -> u16

Maximum flattened descriptor count accepted by normal publication.

Source

pub fn inject_available( &mut self, chain: DriverChain, ) -> Result<PublishedChain, PublishError<DriverChain, SplitQueueError>>

Inject a raw chain into the available ring, retaining malformed topology for device tests.

This differs from DriverQueue::publish only by bypassing profile validation. Descriptor table and available-ring capacity checks still apply.

Source

pub fn set_empty_ring_index( &mut self, index: u16, ) -> Result<(), QueueError<SplitQueueError>>

Set all four ring indices while the configured queue owns no chains.

Source

pub fn set_next_descriptor( &mut self, index: u16, ) -> Result<(), QueueError<SplitQueueError>>

Select the descriptor index at which the next bounded allocation scan begins.

Source

pub fn ring_counters(&self) -> Option<RingCounters>

Return ring counters when storage is configured.

Source

pub fn free_descriptors(&self) -> Option<u16>

Return the number of currently free descriptor-table entries.

Trait Implementations§

Source§

impl Debug for SplitQueue

Source§

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

Formats the value using the given formatter. Read more
Source§

impl DeviceQueue for SplitQueue

Source§

type Chain = SplitDeviceChain

Owned consumed-chain type.
Source§

type Error = SplitQueueError

Concrete transport failure.
Source§

fn pop_available( &mut self, ) -> Result<Option<Self::Chain>, QueueError<Self::Error>>

Consume one available descriptor chain. Read more
Source§

fn complete( &mut self, chain: Self::Chain, used: UsedLength, ) -> Result<NotificationHint, QueueError<Self::Error>>

Publish one chain completion and consume its ownership token. Read more
Source§

fn disable_available_notifications( &mut self, ) -> Result<(), QueueError<Self::Error>>

Disable available-ring notifications before draining work. Read more
Source§

fn enable_available_notifications( &mut self, ) -> Result<NotificationRecheck, QueueError<Self::Error>>

Enable available-ring notifications and atomically recheck for missed work. Read more
Source§

fn reset( &mut self, next_epoch: QueueEpoch, ) -> Result<(), QueueError<Self::Error>>

Invalidate all consumed chains from the old epoch and return the queue to its base state. Read more
Source§

impl DriverQueue for SplitQueue

Source§

type Chain = DriverChain

Driver-owned command and descriptor resources.
Source§

type Reclaimed = ReclaimedChains

Owned collection of chains reclaimed by reset.
Source§

type Error = SplitQueueError

Concrete transport failure.
Source§

fn publish( &mut self, chain: Self::Chain, ) -> Result<PublishedChain, PublishError<Self::Chain, Self::Error>>

Publish a complete chain or return it unchanged on pre-publication backpressure. Read more
Source§

fn pop_used( &mut self, ) -> Result<Option<UsedChain<Self::Chain>>, QueueError<Self::Error>>

Consume one used entry and recover the corresponding driver chain. Read more
Source§

fn disable_used_notifications(&mut self) -> Result<(), QueueError<Self::Error>>

Disable used-ring notifications before draining completions. Read more
Source§

fn enable_used_notifications( &mut self, ) -> Result<NotificationRecheck, QueueError<Self::Error>>

Enable used-ring notifications and atomically recheck for missed completions. Read more
Source§

fn reset( &mut self, next_epoch: QueueEpoch, ) -> Result<Self::Reclaimed, QueueError<Self::Error>>

Invalidate the old epoch and recover every chain still owned by the queue. Read more
Source§

impl QueueControl for SplitQueue

Source§

type Error = SplitQueueError

Concrete transport configuration error.
Source§

fn configure(&mut self, size: QueueSize) -> Result<(), QueueError<Self::Error>>

Configure queue size while the queue is not ready. Read more
Source§

fn set_ready(&mut self, ready: bool) -> Result<(), QueueError<Self::Error>>

Enable or disable queue descriptor processing. Read more
Source§

impl QueuePort for SplitQueue

Source§

fn state(&self) -> QueueState

Return a coherent queue-state snapshot. 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.