Page MenuHomeVyOS Platform

QoS- HTB error when match with a dscp parameter for queue-type 'priority'
Closed, ResolvedPublicBUG

Description

when I'll try to assign a value using dscp to a egress policy , it doesn't works as expect .it show the following messages:

Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/qos.py", line 271, in <module>
    apply(c)
  File "/usr/libexec/vyos/conf_mode/qos.py", line 260, in apply
    tmp.update(shaper_config, direction)
  File "/usr/lib/python3/dist-packages/vyos/qos/trafficshaper.py", line 100, in update
    super().update(config, direction)
  File "/usr/lib/python3/dist-packages/vyos/qos/base.py", line 160, in update
    self._build_base_qdisc(cls_config, int(cls))
  File "/usr/lib/python3/dist-packages/vyos/qos/base.py", line 67, in _build_base_qdisc
    self._cmd(tmp)
  File "/usr/lib/python3/dist-packages/vyos/qos/base.py", line 36, in _cmd
    return cmd(command)
           ^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/util.py", line 161, in cmd
    raise OSError(code, feedback)
PermissionError: [Errno 1] failed to run command: tc qdisc replace dev eth0 parent 400a:1 pfifo limit None
returned:
exit code: 1

noteworthy:
cmd 'tc qdisc del dev lo parent ffff:'
returned (out):

returned (err):
Error: Cannot find specified qdisc on specified device.
cmd 'tc qdisc del dev lo root'
returned (out):

basic configuration :

set qos policy shaper VyOS-HTB bandwidth '100mbit'
set qos policy shaper VyOS-HTB class 10 bandwidth '40%'
set qos policy shaper VyOS-HTB class 10 description 'dscp_EF_ipprec_5_GETS'
set qos policy shaper VyOS-HTB class 10 match cs5 ip dscp 'CS5'
set qos policy shaper VyOS-HTB class 10 priority '1'
set qos policy shaper VyOS-HTB class 10 queue-type 'priority'
set qos policy shaper VyOS-HTB class 20 bandwidth '30%'
set qos policy shaper VyOS-HTB class 20 description 'dscp_AF4x_ipprec_4'
set qos policy shaper VyOS-HTB class 20 match af41 ip dscp 'AF41'
set qos policy shaper VyOS-HTB class 20 priority '2'
set qos policy shaper VyOS-HTB class 20 queue-type 'priority'
set qos policy shaper VyOS-HTB default bandwidth '20%'
set qos policy shaper VyOS-HTB default priority '3'
set qos policy shaper VyOS-HTB default queue-type 'priority'

Details

Difficulty level
Unknown (require assessment)
Version
VyOS 1.4-rolling-202306020317
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Unspecified (please specify)

Event Timeline

With Base Configuration, it's don't have any issues. but after commit command here, error will show error:

set qos interface eth0 egress Vyos

image.png (232×698 px, 12 KB)

I've found the reason why this command fails, it' happens because the logic to match the dscp parameter is missing. So, it tries to apply the basic policy with the tc filter parameters by default :

https://github.com/vyos/vyos-1x/blob/current/python/vyos/qos/base.py#LL185C53-L185C53

this is an example about this case , using tc filter with dscp value (EF) :

tc filter replace dev eth0 parent 1: prio 2 protocol all u32 match ip dsfield 0x2e 0x1e action police rate -1000000 burst 15k flowid 1:14

based on my configuration, it applies the right match filters

vyos@vyos# sudo tc filter  show  dev eth0
filter parent 1: protocol all pref 1 basic chain 0
filter parent 1: protocol all pref 1 basic chain 0 handle 0x1 flowid 1:a
	action order 1:  police 0x1 rate 18446744Tbit burst 0b mtu 2Kb action reclassify overhead 0b
	ref 1 bind 1

filter parent 1: protocol all pref 2 u32 chain 0
filter parent 1: protocol all pref 2 u32 chain 0 fh 800: ht divisor 1
filter parent 1: protocol all pref 2 u32 chain 0 fh 800::800 order 2048 key ht 800 bkt 0 *flowid 1:14 not_in_hw
  match 000e0000/001e0000 at 0
	action order 1:  police 0x2 rate 18446744Tbit burst 0b mtu 2Kb action reclassify overhead 0b
	ref 1 bind 1
Viacheslav renamed this task from QoS- HTB error when match with a dscp parameter to QoS- HTB error when match with a dscp parameter for queue-type 'priority'.Aug 5 2023, 12:23 PM
Viacheslav changed the task status from Open to Needs testing.Aug 6 2023, 9:50 AM
Viacheslav claimed this task.
Viacheslav moved this task from Need Triage to Finished on the VyOS 1.4 Sagitta board.