40 lines
888 B
Bash
Executable File
40 lines
888 B
Bash
Executable File
#!/bin/sh /etc/rc.common
|
|
# Copyright (C) 2017 lean <coolsnowwolf@gmail.com>
|
|
|
|
START=99
|
|
|
|
start() {
|
|
rfc=4096
|
|
threads="$(grep -c "processor" "/proc/cpuinfo")"
|
|
|
|
sysctl -w net.core.rps_sock_flow_entries="$(( rfc * threads ))"
|
|
|
|
for fileRps in /sys/class/net/eth*/queues/rx-*/rps_cpus
|
|
do
|
|
echo "$threads" > "$fileRps"
|
|
done
|
|
|
|
for fileRfc in /sys/class/net/eth*/queues/rx-*/rps_flow_cnt
|
|
do
|
|
echo "$rfc" > "$fileRfc"
|
|
done
|
|
|
|
uci set network.@globals[0].packet_steering="1"
|
|
uci commit network
|
|
|
|
for i in $(ip address | awk -F ': ' '/eth[0-9]+/ {print $2}' | xargs)
|
|
do
|
|
{
|
|
ethtool -K "$i" rx-checksum on
|
|
ethtool -K "$i" tx-checksum-ip-generic on || {
|
|
ethtool -K "$i" tx-checksum-ipv4 on
|
|
ethtool -K "$i" tx-checksum-ipv6 on
|
|
}
|
|
ethtool -K "$i" tx-scatter-gather on
|
|
ethtool -K "$i" gso on
|
|
ethtool -K "$i" tso on
|
|
ethtool -K "$i" ufo on
|
|
}
|
|
done
|
|
} >"/dev/null" 2>&1
|