# Help! How to get the IRQ of a NIC?



## timomeily (Feb 23, 2013)

Does anyone know how to get the IRQ of a network interface in a program? This is trivial in Linux but I am new to FreeBSD.

I need to setup an affinity between a CPU core and a NIC port through its IRQ as specified by the cpuset command. But I can't figure out how to get the IRQ of a network interface in C.
I need to get all the NICs and all the CPU cores so I can assign affinity.
I would like to do this both in user-mode and kernel-mode.


----------



## trasz@ (Feb 28, 2013)

Perhaps take a look how "vmstat -i" works?


----------



## timomeily (Mar 1, 2013)

That is a good suggestion. I was basically considering parsing the boot log.

Thank you.


----------

