#[repr(C, align(2))]pub struct VirtqueueAvailableRing<const MAX_QUEUE_SIZE: usize> { /* private fields */ }
Expand description
The Virtqueue available ring.
This struct is exposed to the VirtIO device as a means to share buffers
(pointed to by descriptors of the VirtqueueDescriptors
descriptors
table) with the VirtIO device (host). It avoids the need for explicit
locking by using two distinct rings, each undirectionally exchanging
information about used buffers. When a new buffer is placed into the
available ring, the VirtIO driver (guest) must increment idx
to the index
where it would place the next available descriptor pointer in the ring
field. After such an update, the queue must inform the device about this
change through a call to VirtIOTransport::queue_notify
. Given that
volatile writes cannot be reordered with respect to each other, changes to
the available ring are guaranteed to be visible to the VirtIO device (host).