Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I would like to obtain information about interrupts assigned to my network cards. Is there any other way, than /proc/interrupts?

share|improve this question
    
Updated my answer for your question about connecting to the interface name –  Kyle Brandt Nov 3 '09 at 12:37
add comment

2 Answers

up vote 6 down vote accepted

There are two common interfaces to kernel information ( other than syscalls ) and they are implemented as filesystems. Those two filesystems are /proc and /sys. sys is a little more organized than proc and newer, but not as user friendly. So it is a little bit better for programmers and to avoid parsing.

If you want the information from the sys filesystem (which lspci parses (see somefile that is outputted by strace -o somefile lspci)):

$ lspci | grep -i network
00:19.0 Ethernet controller: Intel Corporation 82566DC Gigabit Network Connection (rev 02)
$ cat /sys/devices/pci0000:00/0000:00:19.0/irq
2299

Notice the 00:19 relationship between the two commands. The number returned by the irq file will be the same as first column of /proc/interrupts for the relevant device.

If you want more information on the sys filesystem look at the documentation included with the kernel source, for example the text files in /usr/src/linux-source-2.6.27/Documentation/filesystems

Update:

Is there a way to connect the output with interface name?

Sure, if you play around with sys, you will find there are lots of symbolic links that point to other locations in sys. For example, in /sys/class/net:

[kbrandt@kb: /sys/class/net] ls -l
lrwxrwxrwx 1 root root 0 2009-11-02 11:01 eth0 -> ../../devices/pci0000:00/0000:00:19.0/net/eth0
lrwxrwxrwx 1 root root 0 2009-11-02 11:01 lo -> ../../devices/virtual/net/lo
lrwxrwxrwx 1 root root 0 2009-11-02 11:01 pan0 -> ../../devices/virtual/net/pan0
lrwxrwxrwx 1 root root 0 2009-11-02 11:01 vmnet1 -> ../../devices/virtual/net/vmnet1
lrwxrwxrwx 1 root root 0 2009-11-02 11:01 vmnet8 -> ../../devices/virtual/net/vmnet8

So to get the irq for eth0, you can just:

cat /sys/class/net/eth0/../../irq
share|improve this answer
    
Is there a way to connect the output with interface name? –  ctinnist Nov 3 '09 at 11:31
add comment

lspci -v will show you which IRQ is assigned to your network card(s).

Cheers

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.