Skip to main content

Crate virtio_accel_shared_queue

Crate virtio_accel_shared_queue 

Source
Expand description

The protocol 1.0 split virtqueue, laid out in memory a driver and a device share.

virtio-accel-transport says what a queue must do and names no memory. The reference model, virtio-accel-split-queue, does it with both halves in one value that owns every byte, which is what makes it an oracle and what keeps it from being a queue two parties can use. This crate is the same contracts over the real layout (Virtio 1.2 §2.7): a descriptor table, an available ring the driver writes and a used ring the device writes, at device addresses, reached through SharedMemory — the one thing a platform supplies.

Each trusts nothing the other side wrote, allocates nothing, and contains no unsafe: the raw access is behind the trait, in the implementation that knows how its side maps the memory. Storage is inline and sized by const parameters. The profile is the protocol’s — direct descriptors, no indirect tables, no event indices, the two suppression flags.

Structs§

DeviceRing
The device’s half of one split virtqueue in shared memory.
DeviceRingChain
One chain the device took from the available ring and has not yet used. Not Clone: [DeviceQueue::complete] consumes it, so a chain is used once.
DriverChain
A chain a driver owns: the regions the device reads, then the regions it writes, one descriptor each, at most R in all.
DriverRing
The driver’s half of one split virtqueue in shared memory.
ReclaimedChains
The chains a reset took back from the device, each with the identity it was published under.
Region
One run of bytes a descriptor names: a device address and a length.
RingAddresses
Where a driver put a queue’s three parts, as device addresses: what it writes to the transport’s descriptor, driver and device area registers.
RingSink
The bytes a chain gives the device to write.
RingSource
The bytes a chain gives the device to read.

Enums§

Access
What an access does to the bytes it names.
ChainShapeError
Why a set of regions is not a chain.
DeviceRingError
Why the device’s half could not go on. Each is the driver’s doing, and none is one chain’s: a device that sees one stops serving the queue and asks for a reset.
DriverRingError
Why the driver’s half could not go on.
MemoryFault
Why an address did not name memory this side may touch that way.

Constants§

VIRTQ_AVAIL_F_NO_INTERRUPT
The driver asks not to be interrupted when the device uses a chain.
VIRTQ_DESC_F_INDIRECT
The descriptor names an indirect table: not in this profile.
VIRTQ_DESC_F_NEXT
The chain continues at next.
VIRTQ_DESC_F_WRITE
The device writes this descriptor’s bytes; otherwise it reads them.
VIRTQ_USED_F_NO_NOTIFY
The device asks not to be notified when the driver publishes a chain.

Traits§

SharedMemory
The memory a driver and a device share, as one side reaches it.