forked from lede-project/source
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ipq806x: set wan and wifi cpu affinity
At the moment by default all interrupts are assigned to core0. Due to absence of implemented hardware NAT, balancing irq load between cpu cores provides noticeable performance gain - 10-30% depending on usage template. With this script we are adjusting wan and wlan cpu affinity on different cores during boot. After this change: *ipq4019 (has 4 cores (core0-core3)) - wan interrupt is assigned to core1 - 2.4 ghz wifi - to core2 - 5 ghz wifi - to core3 *ipq8064/5 (has 2 cores (core0 and core1)) - wan interrupt is assigned to core1 - 2.4ghz wifi - to core1 Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
target/linux/ipq806x/base-files/etc/init.d/set_cpu_affinity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/sh /etc/rc.common | ||
|
||
START=99 | ||
|
||
set_irq_affinity() { | ||
local name="$1" | ||
local val="$2" | ||
|
||
case "$name" in | ||
wifi0) | ||
local irq_wifi0=`grep -E -m1 'qcom-pcie-msi' /proc/interrupts | cut -d: -f1 | tail -n1 | tr -d ' '` | ||
[ -n "$irq_wifi0" ] || echo "$name irq not found." | ||
echo "$val" > "/proc/irq/$irq_wifi0/smp_affinity" | ||
;; | ||
wifi1) | ||
local irq_wifi1=`grep -E -m2 'qcom-pcie-msi' /proc/interrupts | cut -d: -f1 | tail -n1 | tr -d ' '` | ||
[ -n "$irq_wifi1" ] || echo "$name irq not found." | ||
echo "$val" > "/proc/irq/$irq_wifi1/smp_affinity" | ||
;; | ||
*) | ||
local irq=`grep -m 1 "$name" /proc/interrupts | cut -d: -f1 | sed 's, *,,'` | ||
[ -n "$irq" ] || echo "$name irq not found." | ||
echo "$val" > "/proc/irq/$irq/smp_affinity" | ||
;; | ||
esac | ||
} | ||
|
||
start() { | ||
|
||
local board_name="cat /tmp/sysinfo/board_name" | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
dissent1
Author
Owner
|
||
|
||
case "$board_name" in | ||
fritz4040) | ||
set_irq_affinity eth1 2 | ||
set_irq_affinity wifi0 4 | ||
set_irq_affinity wifi1 8 | ||
;; | ||
ap148 |\ | ||
c2600 |\ | ||
db149 |\ | ||
d7800 |\ | ||
ea8500 |\ | ||
nbg6817 |\ | ||
r7500 |\ | ||
r7500v2 |\ | ||
r7800 |\ | ||
vr2600v) | ||
set_irq_affinity eth0 2 | ||
set_irq_affinity wifi1 2 | ||
;; | ||
*) | ||
echo "Unsupported hardware. CPU affinity is not adjusted." | ||
;; | ||
esac | ||
} |
Should " be replaced by `?