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.
DriverRingis the driver’s half (DriverQueue).DeviceRingis the device’s half (DeviceQueue).
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§
- Device
Ring - The device’s half of one split virtqueue in shared memory.
- Device
Ring Chain - 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. - Driver
Chain - A chain a driver owns: the regions the device reads, then the regions it
writes, one descriptor each, at most
Rin all. - Driver
Ring - The driver’s half of one split virtqueue in shared memory.
- Reclaimed
Chains - 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.
- Ring
Addresses - 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.
- Ring
Sink - The bytes a chain gives the device to write.
- Ring
Source - The bytes a chain gives the device to read.
Enums§
- Access
- What an access does to the bytes it names.
- Chain
Shape Error - Why a set of regions is not a chain.
- Device
Ring Error - 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.
- Driver
Ring Error - Why the driver’s half could not go on.
- Memory
Fault - 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§
- Shared
Memory - The memory a driver and a device share, as one side reaches it.