Skip to content

Commit

Permalink
qualcommax: ipq60xx: add smp_affinity init script
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaY-shi committed Dec 1, 2023
1 parent eb423c2 commit 64ae523
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions target/linux/qualcommax/ipq60xx/base-files/etc/init.d/smp_affinity
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 64ae523

Please sign in to comment.