From 717bc436be07d75d73fd2f62d86534e3a5b028d5 Mon Sep 17 00:00:00 2001 From: Red Bear OS Date: Sun, 26 Jul 2026 17:28:21 +0900 Subject: [PATCH] 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. --- drivers/net/ixgbed/src/main.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/ixgbed/src/main.rs b/drivers/net/ixgbed/src/main.rs index f16c7f9077..c0d509264f 100644 --- a/drivers/net/ixgbed/src/main.rs +++ b/drivers/net/ixgbed/src/main.rs @@ -19,10 +19,14 @@ fn daemon(daemon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> ! { let mut name = pci_config.func.name(); 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 .func - .legacy_interrupt_line - .expect("ixgbed: no legacy interrupts supported"); + .pci_allocate_interrupt_vector(1) + .expect("ixgbed: failed to allocate an interrupt vector"); println!(" + IXGBE {}", pci_config.func.display()); @@ -74,9 +78,6 @@ fn daemon(daemon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> ! { let mut irq = [0; 8]; irq_file.read(&mut irq).unwrap(); 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(); if ours {