pub struct NetworkFrameQueues {
pub guest_to_host: ArrayQueue<Vec<u8>>,
pub host_to_guest: ArrayQueue<Vec<u8>>,
pub guest_wake: WakePipe,
pub host_wake: WakePipe,
pub relay_wake: WakePipe,
/* private fields */
}Expand description
Shared queues and wake handles for the host-side virtio-net runtime.
One NetworkFrameQueues is shared across all helper threads for a single
guest NIC.
A useful mental model is:
queues = ownership transfer for frame bytes
wakes = "go look at the queue now"
shutdown= sticky flag + wake all blocked waitersFields§
§guest_to_host: ArrayQueue<Vec<u8>>Raw ethernet frames emitted by the guest and waiting for smoltcp.
host_to_guest: ArrayQueue<Vec<u8>>Raw ethernet frames emitted by smoltcp and waiting for libkrun.
guest_wake: WakePipeWake the smoltcp poll loop when a guest frame arrives.
host_wake: WakePipeWake the libkrun writer thread when a host frame is ready.
relay_wake: WakePipeWake the smoltcp poll loop when a TCP relay thread has new data.
Implementations§
Source§impl NetworkFrameQueues
impl NetworkFrameQueues
Create a new shared queue set wrapped in Arc.
Sourcepub fn begin_shutdown(&self)
pub fn begin_shutdown(&self)
Mark the runtime as shutting down and wake all waiters.
The wakes are part of shutdown correctness. Without them, a thread
blocked in poll(2) could sleep indefinitely even though the shutdown
flag was already set.
Sourcepub fn is_shutting_down(&self) -> bool
pub fn is_shutting_down(&self) -> bool
Whether shutdown has been requested.