Skip to main content

UringMegakernelPump

Struct UringMegakernelPump 

Source
pub struct UringMegakernelPump<'a> { /* private fields */ }
Expand description

Compose an AsyncUringStream with the megakernel ring-slot writer so the host can drive the compatibility mapped-read ingest loop with one compact pump. Native NVMe → BAR1 ingest is owned by super::driver::NvmeGpuIngestDriver::new_gpudirect.

Implementations§

Source§

impl<'a> UringMegakernelPump<'a>

Source

pub fn new(stream: AsyncUringStream<'a>, chunk_bytes: u32) -> Self

Construct a pump bound to an existing stream. chunk_bytes is the fixed read size - every call to submit_file_scan must request exactly this many bytes.

The pump takes ownership of stream; reclaim it via into_stream on shutdown.

Source

pub fn into_stream(self) -> AsyncUringStream<'a>

Release the underlying stream for explicit shutdown sequences.

Source

pub fn inflight(&self) -> u32

Inflight submissions (submit - drain diff).

Source

pub unsafe fn submit_file_scan( &mut self, fd: i32, file_offset: u64, len: u32, chunk_idx: u32, slot_idx: u32, tenant_id: u32, opcode: u32, args: [u32; 3], ) -> Result<(), PipelineError>

Submit one file-scan read. Destination inside the GPU buffer is chunk_idx * self.chunk_bytes.

On CQE completion, drain_into_ring publishes a megakernel ring slot at slot_idx with tenant_id, opcode, and args. The three args fit in the fixed 3-word prefix of a megakernel slot; callers with more payload use the packed-slot opcode (PACKED_SLOT) out-of- band.

§Errors
§Safety

fd must be an open file descriptor the pump’s io_uring ring can read from. The caller retains ownership - the pump does not close it. len must equal self.chunk_bytes; mismatches are rejected with PipelineError::QueueFull.

Source

pub fn drain_into_ring( &mut self, ring_bytes: &mut [u8], ) -> Result<u32, PipelineError>

Drain completions + publish corresponding ring slots into ring_bytes.

Returns the number of completions processed (including those that surfaced errors - those still advance the inflight counter). The first error is returned via Err(PipelineError::IoUringSyscall); subsequent completions keep draining so the ring does not overflow.

§Errors
Source

pub fn observe_epoch(&self, control_bytes: &[u8]) -> u32

Host-visible epoch field from the megakernel control buffer. The kernel atomic-adds this on every BATCH_FENCE; callers observe forward progress by polling the field between dispatches.

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more