rockchip: remove useless echo in 40-net-smp-affinity
[openwrt/staging/hauke.git] / target / linux / rockchip / armv8 / base-files / etc / hotplug.d / net / 40-net-smp-affinity
1 #!/bin/sh
2
3 [ "$ACTION" = add ] || exit
4
5 get_device_irq() {
6 local device="$1"
7
8 local line=$(grep -m 1 "${device}\$" /proc/interrupts)
9 echo ${line} | sed 's/:.*//'
10 }
11
12 set_interface_core() {
13 local core_mask="$1"
14 local interface="$2"
15 local device="$3"
16
17 [ -z "${device}" ] && device="$interface"
18
19 local irq=$(get_device_irq "$device")
20
21 echo "${core_mask}" > /proc/irq/${irq}/smp_affinity
22 }
23
24 case "$(board_name)" in
25 friendlyarm,nanopi-r2s)
26 set_interface_core 2 "eth0"
27 set_interface_core 4 "eth1" "xhci-hcd:usb3"
28 ;;
29 esac
30