ixgbed: use MSI-X (via pci_allocate_interrupt_vector) when available

The previous code unconditionally required a legacy INTX line, which
on bare metal is missing for nearly every modern 82599/X540/X550
board that has its IRQ lines wired to MSI-X only. pcid_interface
allocates MSI-X when the device advertises it, falls back to MSI,
then to legacy INTX, so the change preserves every existing path
while unlocking the much higher line-rate headroom of MSI-X
per-vector queuing that the device's enable_msix_interrupt code
already implements in device.rs.

The IRQ-acknowledge-and-write pattern is unchanged: the kernel
masks the line on delivery, we must re-arm unconditionally or a
foreign interrupt on a shared line leaves the line masked forever.
This commit is contained in:
Red Bear OS
2026-07-26 17:28:21 +09:00
parent 887718da49
commit 717bc436be
+6 -5
View File
@@ -19,10 +19,14 @@ fn daemon(daemon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> ! {
let mut name = pci_config.func.name(); let mut name = pci_config.func.name();
name.push_str("_ixgbe"); name.push_str("_ixgbe");
// Allocate one interrupt vector. pcid_interface::pci_allocate_interrupt_vector
// prefers MSI-X when the device advertises it and falls back to MSI and
// legacy INTX otherwise, so this single line makes the driver work on
// every modern 82599/X540/X550 board that has MSI-X wired.
let irq = pci_config let irq = pci_config
.func .func
.legacy_interrupt_line .pci_allocate_interrupt_vector(1)
.expect("ixgbed: no legacy interrupts supported"); .expect("ixgbed: failed to allocate an interrupt vector");
println!(" + IXGBE {}", pci_config.func.display()); println!(" + IXGBE {}", pci_config.func.display());
@@ -74,9 +78,6 @@ fn daemon(daemon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> ! {
let mut irq = [0; 8]; let mut irq = [0; 8];
irq_file.read(&mut irq).unwrap(); irq_file.read(&mut irq).unwrap();
let ours = scheme.adapter().irq(); let ours = scheme.adapter().irq();
// The kernel masks the IRQ line on delivery and only re-arms
// it on write-back; ack unconditionally or a foreign interrupt
// on a shared line leaves the line masked forever.
irq_file.write(&mut irq).unwrap(); irq_file.write(&mut irq).unwrap();
if ours { if ours {