Page MenuHomeVyOS Platform

QoS policy shaper vif with ceiling fails on commit
Closed, ResolvedPublicBUG

Description

To reproduce the bug:

touch /tmp/vyos.qos.debug

set qos policy shaper SHAPE bandwidth '1000mbit'
set qos policy shaper SHAPE class 100 bandwidth '100mbit'
set qos policy shaper SHAPE class 100 burst '15k'
set qos policy shaper SHAPE class 100 match V100 vif '100'
set qos policy shaper SHAPE class 100 queue-type 'fair-queue'
set qos policy shaper SHAPE default bandwidth '75%'
set qos policy shaper SHAPE default burst '128k'
set qos policy shaper SHAPE default ceiling '90%'
set qos policy shaper SHAPE default queue-type 'fair-queue'

set qos interface eth1 egress SHAPE

Commit:

DEBUG/QoS: tc qdisc replace dev eth1 root handle 1: htb r2q 625 default 65
DEBUG/QoS: tc class replace dev eth1 parent 1: classid 1:1 htb rate 1000000000
DEBUG/QoS: tc class replace dev eth1 parent 1:1 classid 1:64 htb rate 100000000 burst 15k quantum 1514
DEBUG/QoS: tc qdisc replace dev eth1 parent 1:64 sfq

WARNING: Interface speed cannot be determined (assuming 10 Mbit/s)


WARNING: Interface speed cannot be determined (assuming 10 Mbit/s)

DEBUG/QoS: tc class replace dev eth1 parent 1:1 classid 1:65 htb rate -1000000 burst 128k quantum 1514 prio 20 ceil -1000000
DEBUG/QoS: tc qdisc replace dev eth1 parent 1:65 sfq
{'bandwidth': '1000mbit',
 'class': {'100': {'bandwidth': '100mbit',
                   'burst': '15k',
                   'codel_quantum': '1514',
                   'flows': '1024',
                   'interval': '100',
                   'match': {'V100': {'vif': '100'}},
                   'queue_type': 'fair-queue',
                   'target': '5'}},
 'default': {'bandwidth': '75%',
             'burst': '128k',
             'ceiling': '90%',
             'codel_quantum': '1514',
             'flows': '1024',
             'interval': '100',
             'priority': '20',
             'queue_type': 'fair-queue',
             'target': '5'}}
DEBUG/QoS: tc qdisc replace dev eth1 parent 1:64 sfq
DEBUG/QoS: tc filter add dev eth1 parent 1: protocol all prio 1 action police rate 100000000 burst 15k flowid 1:64
VyOS had an issue completing a command.

Report time:      2024-01-19 10:37:37
Image version:    VyOS 1.5-rolling-202401190024
Release train:    current

Built by:         [email protected]
Built on:         Fri 19 Jan 2024 02:22 UTC
Build UUID:       13700659-ad72-4f7d-ad21-3f2a4b80ab69
Build commit ID:  332e9ab04f168a

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/trafficshaper.py", line 118, in update
    super().update(config, direction)
  File "/usr/lib/python3/dist-packages/vyos/qos/base.py", line 320, in update
    self._cmd(filter_cmd)
  File "/usr/lib/python3/dist-packages/vyos/qos/base.py", line 74, in _cmd
    return cmd(command)
           ^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/utils/process.py", line 155, in cmd
    raise OSError(code, feedback)
PermissionError: [Errno 1] failed to run command: tc filter add dev eth1 parent 1: protocol all prio 1 action police rate 100000000 burst 15k flowid 1:64
returned: 
exit code: 1

noteworthy:
cmd 'tc filter add dev eth1 parent 1: protocol all prio 1 action police rate 100000000 burst 15k flowid 1:64'
returned (out):

returned (err):
Unknown filter "action", hence option "police" is unparsable

[[qos]] failed
Commit failed
[edit]
vyos@r4#

Expected TC:

tc qdisc add dev eth1 root handle 1: htb r2q 625 default 65

tc class add dev eth1 parent 1: classid 1:1 htb rate 1000000000
tc class add dev eth1 parent 1:1 classid 1:65 htb rate 750000000 ceil 900000000 burst 128k
tc class add dev eth1 parent 1:1 classid 1:64 htb rate 100000000 burst 15k

tc qdisc add dev eth1 parent 1:65 sfq
tc qdisc add dev eth1 parent 1:64 sfq

tc filter add dev eth1 parent 1: prio 1 protocol all basic match "meta(vlan mask 0xfff eq 100)" flowid 1:64

Of course, it causes migration to fails. The config is attached

Details

Difficulty level
Normal (likely a few hours)
Version
VyOS 1.5-rolling-202401190024
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 created this task.
Viacheslav changed the task status from Open to In progress.Jan 20 2024, 3:12 PM
Viacheslav changed the task status from In progress to Needs testing.
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.
Viacheslav moved this task from Finished to Backport Candidates on the VyOS 1.4 Sagitta board.
Viacheslav moved this task from Backport Candidates to Finished on the VyOS 1.4 Sagitta board.

Looks good:

vyos@r1# tc class show dev eth1
class htb 1:1 root rate 1Gbit ceil 1Gbit burst 1375b cburst 1375b
class htb 1:64 parent 1:1 leaf 8005: prio 0 rate 100Mbit ceil 100Mbit burst 15337b cburst 1600b
class htb 1:65 parent 1:1 leaf 8006: prio 7 rate 750Mbit ceil 900Mbit burst 130968b cburst 1462b
[edit]
vyos@r1# 

vyos@r1# tc filter show dev eth1
filter parent 1: protocol all pref 1 basic chain 0 
filter parent 1: protocol all pref 1 basic chain 0 handle 0x1 flowid 1:64 
  meta(vlan mask 0x00000fff eq 100)

[edit]
vyos@r1#