#[non_exhaustive]pub enum IrqSelector {
ByNumber(u32),
ByLabel(Cow<'static, str>),
}Expand description
Which IRQ Op::SteerIrq targets.
Two ways to name the same hardware IRQ:
ByNumber— the literal Linux IRQ number (the leading column in/proc/interrupts, the<N>in/proc/irq/<N>/). Use when the scenario already resolved the number (e.g. via the per-NIC IRQ discovery a test does itself).ByLabel— the/proc/interruptsaction name (the last whitespace token on the IRQ’s line). The dispatcher scans/proc/interruptsfor the first line whose last token equals the label and steers that IRQ. Use when the number is not known ahead of time but the device label is stable. On the virtio-MMIO transport ktstr boots, the NIC registers ONE shared IRQ whose action name is the bare device basename (e.g."virtio1"), so that resolves uniquely. Limitation: the match is the line’s last token only — a shared IRQ (a comma-separated action chain) matches just the LAST action, and a multi-word action name never matches. The match deliberately is not widened to any token because the per-CPU count / chip / hwirq columns would then false-match; steer byByNumberfor a shared or multi-word-named IRQ.
§#[non_exhaustive]
IrqSelector is #[non_exhaustive] — see
[crate::non_exhaustive] for the cross-crate pattern-match and
construction rules shared by every such type. Prefer the
by_number / by_label
constructors over naming variants directly.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ByNumber(u32)
The literal Linux IRQ number (the /proc/interrupts leading
column, the <N> in /proc/irq/<N>/smp_affinity_list).
ByLabel(Cow<'static, str>)
The /proc/interrupts action-name label (the line’s last
whitespace token) — resolved to an IRQ number at dispatch.
Implementations§
Source§impl IrqSelector
impl IrqSelector
Sourcepub const fn by_number(irq: u32) -> Self
pub const fn by_number(irq: u32) -> Self
Select an IRQ by its literal Linux IRQ number. Const so it
composes inside const scenarios + builds.
Sourcepub fn by_label(label: impl Into<Cow<'static, str>>) -> Self
pub fn by_label(label: impl Into<Cow<'static, str>>) -> Self
Select an IRQ by its /proc/interrupts action-name label
(the last whitespace token on the IRQ’s line, e.g. a
virtio-net device basename like "virtio1"). Accepts any
string-like input (&'static str, String,
Cow<'static, str>), mirroring the cgroup-name constructor
convention on Op.
Trait Implementations§
Source§impl Clone for IrqSelector
impl Clone for IrqSelector
Source§fn clone(&self) -> IrqSelector
fn clone(&self) -> IrqSelector
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IrqSelector
impl Debug for IrqSelector
Source§impl Hash for IrqSelector
impl Hash for IrqSelector
Source§impl PartialEq for IrqSelector
impl PartialEq for IrqSelector
impl Eq for IrqSelector
impl StructuralPartialEq for IrqSelector
Auto Trait Implementations§
impl Freeze for IrqSelector
impl RefUnwindSafe for IrqSelector
impl Send for IrqSelector
impl Sync for IrqSelector
impl Unpin for IrqSelector
impl UnwindSafe for IrqSelector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more