mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
qosmngr: Improvements on SP and policer cases
This commit is contained in:
parent
2bbe7b1eef
commit
63efd921ed
1 changed files with 16 additions and 6 deletions
|
|
@ -171,8 +171,13 @@ handle_queue() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
[ -f /etc/board.json ] || return 0
|
||||||
if [ $salg -ne 2 ]; then
|
if [ $salg -ne 2 ]; then
|
||||||
priority=`expr $priority - $order`
|
priority=$order
|
||||||
|
wan_port=$(jsonfilter -i /etc/board.json -e @.network.wan.device)
|
||||||
|
if [ "$wan_port" == "$port" ]; then
|
||||||
|
priority=`expr 7 - $order`
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local ceil_rate=$port_bw
|
local ceil_rate=$port_bw
|
||||||
|
|
@ -367,15 +372,20 @@ config_ingress_rate_limit() {
|
||||||
|
|
||||||
ingress_rate=$((ingress_rate / 1000))
|
ingress_rate=$((ingress_rate / 1000))
|
||||||
|
|
||||||
if [ $in_burst_size -eq 0 ]; then
|
local bs=0
|
||||||
in_burst_size=$ingress_rate
|
local avg_bs=$(( ingress_rate * 25 ))
|
||||||
else
|
config_get b_size "$sid" "burst_size"
|
||||||
in_burst_size=$((in_burst_size / 1000))
|
if [ "$in_burst_size" > "0" ]; then
|
||||||
|
bs=`expr $in_burst_size / 1000`
|
||||||
|
fi
|
||||||
|
bs=$(( bs * 8 ))
|
||||||
|
if [ $avg_bs -gt $bs ]; then
|
||||||
|
bs="$avg_bs"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tc qdisc add dev $ifname ingress
|
tc qdisc add dev $ifname ingress
|
||||||
|
|
||||||
tc filter add dev $ifname parent ffff: protocol ip prio $pindex u32 match ip src 0.0.0.0/0 police rate ${ingress_rate}kbit burst $in_burst_size drop flowid :$pindex
|
tc filter add dev $ifname parent ffff: protocol ip prio $pindex u32 match ip src 0.0.0.0/0 police rate ${ingress_rate}kbit burst $bs drop flowid :$pindex
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue