#!/bin/bash SYS_DEV_PATH=$1 IRQ_NUM=$2 MASK=$( printf "%X" $((1<<`lscpu -e=CPU | tail -1`)) ) NIC=`awk 'BEGIN{nic="enp4s0"} {if ($1=="iface") {tmpnic = $2} if ($1=="address") {if ($2 == 10.10.10.10) {nic = tmpnic}}} END{print(nic)}' /etc/network/interfaces` if [ "$NIC" != "" ]; then grep $NIC /proc/interrupts | cut -d ":" -f 1 | while read -r i; do if [ $i -eq $IRQ_NUM ]; then echo "ban=true" echo $MASK > /proc/irq/$IRQ_NUM/smp_affinity fi done fi exit 0