2 [ "$ACTION" = add
] ||
exit
4 NPROCS
="$(grep -c "^processor.
*:" /proc/cpuinfo)"
5 [ "$NPROCS" -gt 1 ] ||
exit
7 PROC_MASK
="$(( (1 << $NPROCS) - 1 ))"
11 local match
="$(grep -m 1 "$dev\$
" /proc/interrupts)"
17 for cur
in $
(seq 1 $NPROCS); do
32 val
="$(printf %x "$val")"
33 [ -n "$DEBUG" ] && echo "$file = $val"
37 packet_steering
="$(uci get "network.@globals
[0].packet_steering
")"
38 [ "$packet_steering" != 1 ] && exit 0
40 exec 512>/var
/lock
/smp_tune.lock
43 for dev
in /sys
/class
/net
/*; do
44 [ -d "$dev" ] ||
continue
46 # ignore virtual interfaces
47 [ -n "$(ls "${dev}/" | grep '^lower_')" ] && continue
48 [ -d "${dev}/device" ] ||
continue
50 device
="$(readlink "${dev}/device
")"
51 device
="$(basename "$device")"
52 irq_cpu
="$(find_irq_cpu "$device")"
53 irq_cpu_mask
="$((1 << $irq_cpu))"
55 for q
in ${dev}/queues
/tx-
*; do
56 set_hex_val
"$q/xps_cpus" "$PROC_MASK"
59 # ignore dsa slave ports for RPS
60 subsys
="$(readlink "${dev}/device
/subsystem
")"
61 subsys
="$(basename "$subsys")"
62 [ "$subsys" = "mdio_bus" ] && continue
64 for q
in ${dev}/queues
/rx-
*; do
65 set_hex_val
"$q/rps_cpus" "$PROC_MASK"