pub enum Violation {
UnexpectedCompletion {
user_data: usize,
},
DuplicateCompletion {
user_data: usize,
},
Outstanding {
user_data: usize,
},
BufferStillInUse {
index: u32,
outstanding: usize,
},
}Expand description
A conservation rule this crate promises, broken.
Variants§
UnexpectedCompletion
A completion arrived carrying user_data that no observed push
produced.
Either the ring completed something twice, or the caller’s own bookkeeping lost a push – and distinguishing those is why the message says which is possible rather than asserting one.
When the completions reported here come from an crate::IoRing’s own
pops, the ring has already checked the identity against what it minted
and panics on one that is not in flight
(D-79), so from such a ring this points at
the caller’s reporting rather than at the kernel.
DuplicateCompletion
Two completions arrived for the same user_data.
The “exactly” half of “exactly one completion”. Counted separately from
Violation::UnexpectedCompletion because a duplicate is a much
stronger signal than an unrecognised identity: it cannot be explained
by a caller forgetting to report a push. A ring’s own pop panics on a
duplicate first (D-79), so from a real ring
this means the caller reported one completion twice.
Outstanding
An operation was pushed and never completed.
BufferStillInUse
A registered buffer still had operations outstanding at quiescence.