From 417a5c542883b65695427ab1bcde3999733bb150 Mon Sep 17 00:00:00 2001 From: Markus Gothe Date: Wed, 17 Sep 2025 14:51:15 +0200 Subject: [PATCH] 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. --- qosmngr/files/airoha/usr/sbin/qos-uplink-bandwidth | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qosmngr/files/airoha/usr/sbin/qos-uplink-bandwidth b/qosmngr/files/airoha/usr/sbin/qos-uplink-bandwidth index 5ef1b2167..81ee2d173 100755 --- a/qosmngr/files/airoha/usr/sbin/qos-uplink-bandwidth +++ b/qosmngr/files/airoha/usr/sbin/qos-uplink-bandwidth @@ -14,11 +14,13 @@ PREV_LINKSPEED=$(cat ${LINKSPEED_FILE} 2>/dev/null) [ -z "${PREV_LINKSPEED}" ] && PREV_LINKSPEED=0 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)) else - /userfs/bin/qosrule discpline Rate uplink-bandwidth $((LINKSPEED*1000)) + /userfs/bin/qosrule discpline Rate uplink-bandwidth $((LINKSPEED*1000*990/1000)) fi mkdir -p "/tmp/qos" echo ${LINKSPEED} > ${LINKSPEED_FILE} fi + +hw_nat -! > /dev/null 2>&1