testing: Make per-CPU SAs scenarios more predictable by pinning IRQs to vCPUs
This ensures that packets on sun are processed on a particular CPU and not randomly on one, which causes expected SAs not to get created or other weird things.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#! /bin/bash
|
||||
#!/bin/bash
|
||||
|
||||
while getopts "46idt:lr" opt
|
||||
do
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Sets the CPU affiniy of the IRQ handling inbound messages on the given
|
||||
# network interface
|
||||
|
||||
IFACE=$1
|
||||
AFFINITY=$2
|
||||
|
||||
if [ -z "$IFACE" -o -z "$AFFINITY" ]
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PCI_ADDR=$(ethtool -i ${IFACE} | grep bus-info | sed -e 's/bus-info: //')
|
||||
if [ -z "$PCI_ADDR" ]
|
||||
then
|
||||
exit 2
|
||||
fi
|
||||
|
||||
IRQ=$(grep "MSIX-${PCI_ADDR}.*input" /proc/interrupts | awk -F ':' '{print $1}' | awk '{print $1}')
|
||||
if [ -z "$IRQ" ]
|
||||
then
|
||||
exit 3
|
||||
fi
|
||||
|
||||
PREV=$(cat /proc/irq/${IRQ}/smp_affinity_list)
|
||||
echo "Setting affinity for IRQ ${IRQ} of ${IFACE}@${PCI_ADDR} to ${AFFINITY}, was ${PREV}"
|
||||
echo ${AFFINITY} > /proc/irq/${IRQ}/smp_affinity_list
|
||||
Reference in New Issue
Block a user