mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
qosmngr: airoha: Fix uplink bandwidth calculation.
For lower speeds we need to adjust the bandwidth calculation for QoS to work on AN7581 (but not on EN7523). Also make sure we clear old HW NAT entries if the uplink bandwidth changes for QoS to take effect immediaty.
This commit is contained in:
parent
0074af0d3c
commit
417a5c5428
1 changed files with 4 additions and 2 deletions
|
|
@ -14,11 +14,13 @@ PREV_LINKSPEED=$(cat ${LINKSPEED_FILE} 2>/dev/null)
|
||||||
[ -z "${PREV_LINKSPEED}" ] && PREV_LINKSPEED=0
|
[ -z "${PREV_LINKSPEED}" ] && PREV_LINKSPEED=0
|
||||||
|
|
||||||
if [ $((LINKSPEED)) -ne $((PREV_LINKSPEED)) -a $((LINKSPEED)) -ne 0 ]; then
|
if [ $((LINKSPEED)) -ne $((PREV_LINKSPEED)) -a $((LINKSPEED)) -ne 0 ]; then
|
||||||
if [ $((LINKSPEED)) -ge 10000 ]; then
|
if [ $((LINKSPEED)) -ge 100 ]; then
|
||||||
/userfs/bin/qosrule discpline Rate uplink-bandwidth $((LINKSPEED*1000*999/1000))
|
/userfs/bin/qosrule discpline Rate uplink-bandwidth $((LINKSPEED*1000*999/1000))
|
||||||
else
|
else
|
||||||
/userfs/bin/qosrule discpline Rate uplink-bandwidth $((LINKSPEED*1000))
|
/userfs/bin/qosrule discpline Rate uplink-bandwidth $((LINKSPEED*1000*990/1000))
|
||||||
fi
|
fi
|
||||||
mkdir -p "/tmp/qos"
|
mkdir -p "/tmp/qos"
|
||||||
echo ${LINKSPEED} > ${LINKSPEED_FILE}
|
echo ${LINKSPEED} > ${LINKSPEED_FILE}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
hw_nat -! > /dev/null 2>&1
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue