I need to retrieve an interrupt number of interface by its' name as appears in ifconfig.
Is there some standard API to do it?
The interrupt number lives in sysfs. Look for the file /sys/class/net/[ethname]/device/irq. For example:
more /sys/class/net/*/device/irq
::::::::::::::
/sys/class/net/eth0/device/irq
::::::::::::::
30
::::::::::::::
/sys/class/net/eth1/device/irq
::::::::::::::
29
/sys/class/net/[ethname]/device/irq should legacy irq number, device may not be using legacy irq, it may be using msix.
check
$ ls /sys/class/net/eth0/device/msi_irqs/
or
$ grep eth0 /proc/interrupts
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With