dacd1adc7e0fa39adce38d500cb95cd21b0f15d9
[openwrt/staging/aparcar.git] / target / linux / bcm53xx / base-files / usr / libexec / platform / packet-steering.sh
1 #!/bin/sh /etc/rc.common
2
3 packet_steering="$(uci -q get network.@globals[0].packet_steering)"
4 flow_offloading="$(uci -q get firewall.@defaults[0].flow_offloading)"
5 flow_offloading_hw="$(uci -q get firewall.@defaults[0].flow_offloading_hw)"
6
7 [ "$packet_steering" != 1 ] && {
8 echo 0 > /sys/class/net/br-lan/queues/rx-0/rps_cpus
9 echo 0 > /sys/class/net/eth0/queues/rx-0/rps_cpus
10 exit 0
11 }
12
13 if [ ${flow_offloading_hw:-0} -gt 0 ]; then
14 # HW offloading
15 echo 0 > /sys/class/net/br-lan/queues/rx-0/rps_cpus
16 echo 0 > /sys/class/net/eth0/queues/rx-0/rps_cpus
17 elif [ ${flow_offloading:-0} -gt 0 ]; then
18 # SW offloading
19 # br-lan setup doesn't seem to matter for offloading case
20 echo 2 > /sys/class/net/eth0/queues/rx-0/rps_cpus
21 else
22 # Default
23 echo 2 > /sys/class/net/br-lan/queues/rx-0/rps_cpus
24 echo 0 > /sys/class/net/eth0/queues/rx-0/rps_cpus
25 fi