rpi4-files/etc/init.d/irq-eth-pin: fix compile error/warning
initscripts will run while building OpenWRT images on the host system as described on the wiki: https://openwrt.org/docs/guide-developer/procd-init-scripts#init_scripts_during_compilation Thus we no longer execute any commands and wrap functionality into proper start_service() function
This commit is contained in:
@@ -3,22 +3,25 @@
|
|||||||
uci_banirq=irqbalance.irqbalance.banirq
|
uci_banirq=irqbalance.irqbalance.banirq
|
||||||
cpu_irq_eth=2
|
cpu_irq_eth=2
|
||||||
|
|
||||||
# Move eth0 IRQs to CPU1 (numbered 1-4 when writing)
|
move_eth0_irq() {
|
||||||
# And ban irqbalance from messing with it
|
# Move eth0 IRQs to CPU1 (numbered 1-4 when writing)
|
||||||
# The USB3 Ethernet IRQs cannot be moved and must stay on CPU0
|
# And ban irqbalance from messing with it
|
||||||
irqs_eth0=$(sed -rn "s/^\s*([0-9]+):.*eth0$/\1/p" /proc/interrupts)
|
# The USB3 Ethernet IRQs cannot be moved and must stay on CPU0
|
||||||
|
irqs_eth0=$(sed -rn "s/^\s*([0-9]+):.*eth0$/\1/p" /proc/interrupts)
|
||||||
|
|
||||||
for n in ${irqs_eth0}; do
|
for n in ${irqs_eth0}; do
|
||||||
echo ${cpu_irq_eth} > /proc/irq/${n}/smp_affinity
|
echo ${cpu_irq_eth} > /proc/irq/${n}/smp_affinity
|
||||||
if ! uci get ${uci_banirq} | grep -q ${n}; then
|
if ! uci get ${uci_banirq} | grep -q ${n}; then
|
||||||
uci add_list ${uci_banirq}=${n}
|
uci add_list ${uci_banirq}=${n}
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
uci commit
|
uci commit irqbalance
|
||||||
|
|
||||||
logger -t "irq_eth_pin" "Moved eth0 IRQs ${irqs_eth0} to cpu${cpu_irq_eth}"
|
logger -t "irq_eth_pin" "Moved eth0 IRQs ${irqs_eth0} to cpu${cpu_irq_eth}"
|
||||||
|
logger -t "irq_eth_pin" "See all interrupts with: cat /proc/interrupts"
|
||||||
|
}
|
||||||
|
|
||||||
softirqs_move() {
|
move_softirqs() {
|
||||||
# Move softirqs for network traffic to CPU2 and CPU3
|
# Move softirqs for network traffic to CPU2 and CPU3
|
||||||
# Maybe not a brilliant idea because the softirqs are probably better off
|
# Maybe not a brilliant idea because the softirqs are probably better off
|
||||||
# being processed on the CPU that got the original IRQ
|
# being processed on the CPU that got the original IRQ
|
||||||
@@ -34,3 +37,7 @@ softirqs_move() {
|
|||||||
done
|
done
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
start_service() {
|
||||||
|
move_eth0_irq
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user