
Issue 11
© Solarflare Communications 2014
93
Solarflare Server Adapter
User Guide
If the settings have been correctly applied, all interrupts from
eth0
are being handled on
CPU[0]
.
This can be checked:
# cat /proc/interrupts | grep eth0-
Example 2:
An example of affinitizing each interface to a CPU on the same package:
First identify which interrupt lines are servicing which CPU and IO device:
# cat /proc/interrupts | grep eth0-
123: 13302 0 1278131 0 PCI-MSI-X eth0-0
# cat /proc/interrupts | grep eth1-
131: 0 24 0 0 PCI-MSI-X eth1-0
Find CPUs on same package (have same ‘package-id’):
# more /sys/devices/system/cpu/cpu*/topology/physical_package_id
::::::::::::::
/sys/devices/system/cpu/cpu0/topology/physical_package_id
::::::::::::::
1
::::::::::::::
/sys/devices/system/cpu/cpu10/topology/physical_package_id
::::::::::::::
1
::::::::::::::
/sys/devices/system/cpu/cpu11/topology/physical_package_id
::::::::::::::
0
…
Having determined that cpu0 and cpu10 are on package 1, we can assign each ethX interface’s MSI-
X interrupt to its own CPU on the same package. In this case we choose package 1:
NOTE:
The use of taskset is typically only suitable for affinity tuning single threaded, single traffic
flow applications. For a multi threaded application, whose threads for example process a subset of
receive traffic, taskset is not suitable. In such applications, it is desirable to use RSS and Interrupt
affinity to spread receive traffic over more than one CPU and then have each receive thread bind to
each of the respective CPUs. Thread affinities can be set inside the application with the
shed_setaffinity()
function (see Linux man pages). Use of this call and how a particular
application can be tuned is beyond the scope of this guide.
123:
13302
0
1278131
0
PCI-MSI-X eth0-0
131:
0
24
0
0
PCI-MSI-X eth0-1
139:
0
0
32
0
PCI-MSI-X eth0-2
147:
0
0
0
21
PCI-MSI-X eth0-3