qosmngr: fix lan traffic limited to 1G always

Problem description:
Two problems seen,
1. The queues on a port are by default setup to handle maximum rate
   of 1G
2. The default qos uci config for ipq and brcm platforms is different

Fix:
1. Update queue setup to not impose rate limit, by setting the maximum
   rate as the maximum rate supported by the port.
2. Update uci default script to generate same config for both platforms
This commit is contained in:
Rahul Thakur 2024-01-18 15:14:43 +05:30
parent 570cd68d15
commit aa1adcad3c
4 changed files with 14 additions and 24 deletions

View file

@ -15,10 +15,6 @@ include /lib/ethernet
. /lib/qos/shaper.sh
. /lib/qos/airoha.sh
get_rate_per_queue() {
echo "0"
}
get_burst_size_per_queue() {
echo "0"
}

View file

@ -34,10 +34,6 @@ get_port_number() {
done
}
get_rate_per_queue() {
echo "0"
}
get_burst_size_per_queue() {
echo "0"
}

View file

@ -31,7 +31,7 @@ generate_queue(){
uci set qos.@queue[-1].ifname="$ifname"
uci set qos.@queue[-1].precedence="$order"
uci set qos.@queue[-1].scheduling="SP"
uci set qos.@queue[-1].rate=$(get_rate_per_queue)
uci set qos.@queue[-1].rate="0"
uci set qos.@queue[-1].burst_size=$(get_burst_size_per_queue)
uci set qos.@queue[-1].weight="1"
done

View file

@ -15,10 +15,6 @@ Q_COUNT=0
SP_Q_PRIO=7
SOQ_wgt=0
get_rate_per_queue() {
echo "1000000"
}
get_burst_size_per_queue() {
echo "1500"
}
@ -405,18 +401,20 @@ pre_configure_queue() {
}
get_link_rate() {
intf="$1"
speed=1000
local ifname="$1"
local phycap="$(ethtool $ifname | grep -A 10 "Supported link modes" | grep 00 | tail -n 1 | awk '{print$NF}')"
local speed=1000
if [ -d "/sys/class/net/$intf/" ]; then
speed=$(cat /sys/class/net/$intf/speed 2>/dev/null)
[ -z "$speed" ] & speed=1000
fi
if [ $speed -le 0 ]; then
# assuming default 1000
speed=1000
fi
# Get the max capability of this port
case "$phycap" in
10000*) speed=10000 ;;
5000*) speed=5000 ;;
2500*) speed=2500 ;;
1000*) speed=1000 ;;
100*) speed=100 ;;
10*) speed=10 ;;
*) speed=1000 ;;
esac
echo "$speed"
}