iopsys-feed/qosmngr/files/etc/uci-defaults/60-qos_queue_generate
Rahul 4b707a26f4 Fix Bug #3822: BurstSize default value updated
The default value of burst size in config is set to -1 which is one
part of the problem. The other part of the problem is that the check
in tr181 is not good enough to disallow negative values. That will
be fixed in a seprate patch.
2020-11-17 16:32:29 +05:30

53 lines
1 KiB
Bash

#!/bin/sh
. /lib/functions.sh
ethwan="$(db -q get hw.board.ethernetWanPort)"
cpu_model="$(grep Hardware /proc/cpuinfo | awk '{print$NF}')"
generate_queue(){
section="$1"
config_get ifname "$section" "ifname"
local is_lan=0
if [ "$ifname" != "$ethwan" ]; then
is_lan=1
fi
local no_of_q="0 1 2 3 4 5 6 7"
if [ $is_lan -eq 1 ]; then
case $cpu_model in
BCM968*) no_of_q="0 1 2 3" ;;
esac
fi
i=0
for i in $no_of_q; do
uci add qos queue
uci rename qos.@queue[-1]="q_${i}_${ifname}"
uci set qos.@queue[-1].enable="1"
uci set qos.@queue[-1].ifname="$ifname"
uci set qos.@queue[-1].precedence="$i"
uci set qos.@queue[-1].scheduling="SP"
uci set qos.@queue[-1].rate="0"
uci set qos.@queue[-1].burst_size="0"
uci set qos.@queue[-1].weight="1"
done
uci commit qos
}
if [ -s "/etc/config/qos" ]; then
if uci -q get qos.@queue[0] >/dev/null; then
# return if there is any valid content
exit
else
rm -f /etc/config/qos
fi
fi
touch /etc/config/qos
config_load ports
config_foreach generate_queue ethport