Page MenuHomeVyOS Platform

QoS policy limiter without specified class selector error
Closed, ResolvedPublicBUG

Description

To reproduce use match ip without class selector:

set qos interface eth1 ingress 'LIMITER'
set qos policy limiter LIMITER class 1 bandwidth '20mbit'
set qos policy limiter LIMITER class 1 burst '1mb'
set qos policy limiter LIMITER class 1 match ALL ip
set qos policy limiter LIMITER default bandwidth '20mbit'
set qos policy limiter LIMITER default burst '1mb'
commit

commit:

vyos@r4# commit
[ qos ]
DEBUG/QoS: tc qdisc add dev eth1 handle ffff: ingress
{'class': {'1': {'bandwidth': '20mbit',
                 'burst': '1mb',
                 'exceed': 'drop',
                 'match': {'ALL': {'ip': {}}},
                 'not_exceed': 'ok',
                 'priority': '20'}},
 'default': {'bandwidth': '20mbit',
             'burst': '1mb',
             'exceed': 'drop',
             'not_exceed': 'ok'}}
DEBUG/QoS: tc filter add dev eth1 parent ffff: prio 20 protocol all u32 flowid ffff:1

Report time:      2024-02-12 19:10:39
Image version:    VyOS 1.5-rolling-202402120819
Release train:    current

Built by:         [email protected]
Built on:         Mon 12 Feb 2024 10:20 UTC
Build UUID:       b1a917a9-cda4-49ad-a327-58321f1067dc
Build commit ID:  8c5299e1cf7c7b

Architecture:     x86_64
Boot via:         installed image
System type:      KVM guest

Hardware vendor:  QEMU
Hardware model:   Standard PC (Q35 + ICH9, 2009)
Hardware S/N:     
Hardware UUID:    166cfd25-7d3a-4eca-9ef6-0b655c9acf0f

Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/qos.py", line 240, in <module>
    apply(c)
  File "/usr/libexec/vyos/conf_mode/qos.py", line 231, in apply
    tmp.update(shaper_config, direction)
  File "/usr/lib/python3/dist-packages/vyos/qos/limiter.py", line 27, in update
    super().update(config, direction)
  File "/usr/lib/python3/dist-packages/vyos/qos/base.py", line 306, in update
    self._cmd(filter_cmd)
  File "/usr/lib/python3/dist-packages/vyos/qos/base.py", line 75, in _cmd
    return cmd(command)
           ^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/utils/process.py", line 155, in cmd
    raise OSError(code, feedback)
FileNotFoundError: [Errno 2] failed to run command: tc filter add dev eth1 parent ffff: prio 20 protocol all u32 flowid ffff:1
returned: 
exit code: 2



returned (err):
Error: Cannot delete qdisc with handle of zero.
cmd 'tc filter add dev eth1 parent ffff: prio 20 protocol all u32 flowid ffff:1'
returned (out):

returned (err):
Error: cls_u32: Selector not specified.
We have an error talking to the kernel

If we add the correct class selector, the commit looks good, for example:

set qos policy limiter LIMITER class 1 match ALL ip protocol 'ip'
commit

Details

Difficulty level
Normal (likely a few hours)
Version
VyOS 1.5-rolling-202402120819
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 triaged this task as Normal priority.
Viacheslav updated the task description. (Show Details)

looks like the problem doesn't reproduce on the newest VyOS version (1.5 and 1.4)

vyos@vyos# run show system image 
Name                      Default boot    Running
------------------------  --------------  ---------
1.5-rolling-202405080016  Yes             Yes
[edit]
vyos@vyos# set qos interface eth1 ingress 'LIMITER'
[edit]
vyos@vyos# set qos policy limiter LIMITER class 1 bandwidth '20mbit'
[edit]
vyos@vyos# set qos policy limiter LIMITER class 1 burst '1mb'
[edit]
vyos@vyos# set qos policy limiter LIMITER class 1 match ALL ip
[edit]
vyos@vyos# set qos policy limiter LIMITER default bandwidth '20mbit'
[edit]
vyos@vyos# set qos policy limiter LIMITER default burst '1mb'
[edit]
vyos@vyos# commit
DEBUG/QoS: tc qdisc add dev eth1 handle ffff: ingress
{'class': {'1': {'bandwidth': '20mbit',
                 'burst': '1mb',
                 'exceed': 'drop',
                 'not_exceed': 'ok',
                 'priority': '20'}},
 'default': {'bandwidth': '20mbit',
             'burst': '1mb',
             'exceed': 'drop',
             'not_exceed': 'ok'}}
DEBUG/QoS: tc filter replace dev eth1 parent ffff: prio 255 protocol all basic action police conform-exceed drop/ok rate 20000000 burst 1mb flowid ffff:2
[edit]
vyos@vyos#

speed test info:

set qos interface eth0 ingress 'LIMITER'
set qos policy limiter LIMITER class 1 bandwidth '10mbit'
set qos policy limiter LIMITER class 1 burst '1mb'
set qos policy limiter LIMITER class 1 match ALL ip
set qos policy limiter LIMITER default bandwidth '30mbit'
set qos policy limiter LIMITER default burst '1mb'
commit
iperf3 -c 192.168.122.166
Connecting to host 192.168.122.166, port 5201
[  5] local 192.168.122.1 port 60540 connected to 192.168.122.166 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  4.65 MBytes  39.0 Mbits/sec  368   25.5 KBytes       
[  5]   1.00-2.00   sec  3.42 MBytes  28.7 Mbits/sec  373   18.4 KBytes       
[  5]   2.00-3.00   sec  3.60 MBytes  30.2 Mbits/sec  348   7.07 KBytes       
[  5]   3.00-4.00   sec  3.11 MBytes  26.1 Mbits/sec  220   4.24 KBytes       
[  5]   4.00-5.00   sec  3.23 MBytes  27.1 Mbits/sec  257   2.83 KBytes       
[  5]   5.00-6.00   sec  4.16 MBytes  34.9 Mbits/sec  328   2.83 KBytes       
[  5]   6.00-7.00   sec  3.36 MBytes  28.1 Mbits/sec  273   9.90 KBytes       
[  5]   7.00-8.00   sec  3.23 MBytes  27.1 Mbits/sec  311   2.83 KBytes       
[  5]   8.00-9.00   sec  3.54 MBytes  29.7 Mbits/sec  301   2.83 KBytes       
[  5]   9.00-10.00  sec  3.17 MBytes  26.6 Mbits/sec  300   4.24 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  35.5 MBytes  29.8 Mbits/sec  3079             sender
[  5]   0.00-10.00  sec  35.0 MBytes  29.3 Mbits/sec                  receiver
HollyGurza moved this task from Need Triage to Finished on the VyOS 1.5 Circinus board.