简体   繁体   English

检索 NIC 的 irq 编号

[英]Retrieving irq number of a NIC

I need to retrieve an interrupt number of interface by its' name as appears in ifconfig.我需要通过 ifconfig 中显示的名称检索接口的中断号。

Is there some standard API to do it?是否有一些标准的 API 来做到这一点?

The interrupt number lives in sysfs.中断号存在于 sysfs 中。 Look for the file /sys/class/net/[ethname]/device/irq .查找文件/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 . /sys/class/net/[ethname]/device/irq应该是legacy irq number ,设备可能没有使用 legacy irq,它可能正在使用msix

check查看

$ ls /sys/class/net/eth0/device/msi_irqs/

or要么

$ grep eth0 /proc/interrupts

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM