Page MenuHomeVyOS Platform

QoS policy shaper target and interval wrong calcuations
Closed, ResolvedPublicBUG

Description

Thre report from the forum discussion https://forum.vyos.io/t/what-kind-of-performance-should-be-expected-when-applying-fq-codel-on-a-shaper-policy
Wrong calculations for interval and target
To reproduce

set qos policy shaper WAN-OUT bandwidth '40mbit'
set qos policy shaper WAN-OUT default bandwidth '100%'
set qos policy shaper WAN-OUT default burst '15k'
set qos policy shaper WAN-OUT default queue-type 'fq-codel'
set qos interface eth1 egress 'WAN-OUT'


commit
vyos@r4# commit
[ qos ]
DEBUG/QoS: tc qdisc replace dev eth1 root handle 1: htb r2q 25 default 1
DEBUG/QoS: tc class replace dev eth1 parent 1: classid 1:1 htb rate 40000000
DEBUG/QoS: tc class replace dev eth1 parent 1:1 classid 1:1 htb rate 40000000 burst 15k quantum 1514 prio 20
DEBUG/QoS: tc qdisc replace dev eth1 parent 1:1 sfq
{'bandwidth': '40mbit',
 'default': {'bandwidth': '100%',
             'burst': '15k',
             'codel_quantum': '1514',
             'flows': '1024',
             'interval': '100',
             'priority': '20',
             'queue_type': 'fq-codel',
             'target': '5'}}
DEBUG/QoS: tc qdisc replace dev eth1 parent 1:1 fq_codel quantum 1514 flows 1024 interval 100 interval 100 target 5 noecn

The values in us expected values in ms
4us 99us

vyos@r4# sudo tc qdisc show dev eth1
qdisc htb 1: root refcnt 2 r2q 25 default 0x1 direct_packets_stat 0 direct_qlen 1000
qdisc fq_codel 8002: parent 1:1 limit 10240p flows 1024 quantum 1514 target 4us interval 99us memory_limit 32Mb drop_batch 64

The same config for 1.3 works fine

set traffic-policy shaper WAN-OUT bandwidth '40mbit'
set traffic-policy shaper WAN-OUT default bandwidth '100%'
set traffic-policy shaper WAN-OUT default burst '15k'
set traffic-policy shaper WAN-OUT default queue-type 'fq-codel'
set interfaces ethernet eth1 traffic-policy out 'WAN-OUT'

Check:

[edit]
vyos@r15-left# sudo tc qdisc show dev eth1
qdisc htb 1: root refcnt 2 r2q 25 default 0x2 direct_packets_stat 0 direct_qlen 1000
qdisc fq_codel 8002: parent 1:2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 32Mb 
[edit]

The possible bug in the calculations here https://github.com/vyos/vyos-1x/blob/c095867d873a9a7dde038bb751ba26edc66b99f7/python/vyos/qos/fqcodel.py#L27-L34

Details

Difficulty level
Normal (likely a few hours)
Version
VyOS 1.5-rolling-202402270022, 1.4.0-epa
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)