Page MenuHomeVyOS Platform

QoS policy shaper wrong class_id_max and default_minor_id
Closed, ResolvedPublicBUG

Description

The class_id_max is wrong due to tmp.sort of Strings
If we have class 5 and class 10 we get sorted max value 5, expected 10

set qos policy shaper SHAPE bandwidth '710mbit'
set qos policy shaper SHAPE class 5 bandwidth '2%'
set qos policy shaper SHAPE class 5 match tiny4 ip tcp syn

set qos policy shaper SHAPE class 10 bandwidth '1%'
set qos policy shaper SHAPE class 10 match dns ip protocol 'udp'

set qos policy shaper SHAPE default bandwidth '95%'
set qos policy shaper SHAPE default ceiling '100%'
set qos policy shaper SHAPE default codel-quantum '8000'

set qos interface eth1 egress SHAPE
commit

It causes of wrong "tc qdisc default" default_minor_id value https://github.com/vyos/vyos-1x/blob/e07b8b77930b92a09d1aac0b7de82aa0081ad3e5/python/vyos/qos/trafficshaper.py#L61-L62

>>> tmp = ['5', '10']
>>> tmp.sort()
>>> tmp
['10', '5']
>>> 

>>> hex(5+1)
'0x6'
>>> 
>>> hex(10+1)
'0xb'
>>>

This way we get

tc qdisc replace dev eth1 root handle 1: htb r2q 444 default 6

But expect b

tc qdisc replace dev eth1 root handle 1: htb r2q 444 default b

Details

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

Event Timeline

Viacheslav changed the task status from Open to In progress.Feb 9 2024, 10:14 AM
Viacheslav claimed this task.
Viacheslav created this task.
Viacheslav moved this task from Need Triage to Finished on the VyOS 1.5 Circinus board.
Viacheslav moved this task from Need Triage to Finished on the VyOS 1.4 Sagitta board.