From 1c955f529d3288d0111e8f14801ff47d75c1860e Mon Sep 17 00:00:00 2001 From: JiaY-shi Date: Thu, 17 Aug 2023 22:16:06 +0800 Subject: [PATCH] qualcommax: ipq60xx: add smp_affinity init script --- .../base-files/etc/init.d/smp_affinity | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 target/linux/qualcommax/ipq60xx/base-files/etc/init.d/smp_affinity diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/init.d/smp_affinity b/target/linux/qualcommax/ipq60xx/base-files/etc/init.d/smp_affinity new file mode 100755 index 00000000000000..18db2d912ddc9a --- /dev/null +++ b/target/linux/qualcommax/ipq60xx/base-files/etc/init.d/smp_affinity @@ -0,0 +1,30 @@ +#!/bin/sh /etc/rc.common + +START=99 + +enable_affinity_ipq807x(){ + set_affinity() { + irq=$(awk "/$1/{ print substr(\$1, 1, length(\$1)-1); exit }" /proc/interrupts) + [ -n "$irq" ] && echo $2 > /proc/irq/$irq/smp_affinity + } + + # assign 4 rx interrupts to each core + set_affinity 'reo2host-destination-ring1' 1 + set_affinity 'reo2host-destination-ring2' 2 + set_affinity 'reo2host-destination-ring3' 4 + set_affinity 'reo2host-destination-ring4' 8 + + # assign 3 tcl completions to last 3 CPUs + set_affinity 'wbm2host-tx-completions-ring1' 2 + set_affinity 'wbm2host-tx-completions-ring2' 4 + set_affinity 'wbm2host-tx-completions-ring3' 8 +} + +boot() { + case $(board_name) in + glinet,gl-axt1800|\ + glinet,gl-ax1800) + enable_affinity_ipq807x + ;; + esac +}