mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
qosmngr: airoha: fix bw overwrite in case of reload and shaping
This commit is contained in:
parent
1821af8963
commit
b6930a2056
2 changed files with 10 additions and 1 deletions
|
|
@ -190,11 +190,18 @@ hw_commit_all() {
|
|||
;;
|
||||
esac
|
||||
|
||||
rm -f "/tmp/qos/wan_link_shape_rate"
|
||||
rm -f "/tmp/qos/wan_link_speed"
|
||||
if [ "${glob_alg}" != "" ] ; then
|
||||
/userfs/bin/qosrule discpline $(hw_sc_alg2str ${glob_alg}) ${weight_list} \
|
||||
uplink-bandwidth ${shape_rate:-10000000} \
|
||||
queuemask "$(((1 << q_count) - 1))"
|
||||
echo ${mac_qos_flag} > /proc/qdma_wan/mac_qos_flag
|
||||
if [ -n "${shape_rate}" ]; then
|
||||
echo "${shape_rate}" > "/tmp/qos/wan_link_shape_rate"
|
||||
else
|
||||
/usr/sbin/qos-uplink-bandwidth
|
||||
fi
|
||||
else
|
||||
/userfs/bin/qosrule discpline Enable 0
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@
|
|||
|
||||
readonly WANPORT="$(jsonfilter -i /etc/board.json -e @.network.wan.device)"
|
||||
readonly LINKSPEED_FILE="/tmp/qos/wan_link_speed"
|
||||
readonly LINKSHAPE_FILE="/tmp/qos/wan_link_shape_rate"
|
||||
|
||||
[ "${WANPORT}" = "${PORT}" ] || exit 0
|
||||
[ -z "${PORT}" -o "${WANPORT}" = "${PORT}" ] || exit 0
|
||||
[ -f "${LINKSHAPE_FILE}" ] && exit 0
|
||||
|
||||
LINKSPEED="$(devstatus "${WANPORT}" | jsonfilter -e '@["speed"]' | tr -d 'A-Z')"
|
||||
PREV_LINKSPEED=$(cat ${LINKSPEED_FILE} 2>/dev/null)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue