[Question] Generic way to retrieve IRQ number of Tx/Rx queue

From: Daniel Sedlak
Date: Fri Jan 10 2025 - 04:07:29 EST


Hello,
I am writing an affinity scheduler in the userspace for network cards's Tx/Rx queues. Is there a generic way to retrieve all IRQ numbers for those queues for each interface?

My goal is to get all Tx/Rx queues for a given interface, get the IRQ number of the individual queues, and set an affinity hint for each queue. I have tried to loop over /proc/interrupts to retrieve all queues for an interface in a hope that the last column would contain the interface name however this does not work since the naming is not unified across drivers. My second attempt was to retrieve all registered interrupts by network interface from /sys/class/net/{interface_name}/device/msi_irqs/, but this attempt was also without luck because some drivers request more IRQs than the number of queues (for example i40e driver).

Thank you for any help or advice

Daniel