Page MenuHomeVyOS Platform

"show qos shaper" doesn't work with VRFs
Closed, ResolvedPublicBUG

Description

some operational command related to qos on VRF , doesn't work. although. it works when we use native linux commands .eg :

 vyos@qos-test:~$ show configuration commands | match qos
set qos interface eth0 egress 'TEST'
set interfaces ethernet eth0 vrf 'TEST'
set vrf bind-to-all
set vrf name TEST table '200'

set qos policy shaper TEST bandwidth '100mbit'
set qos policy shaper TEST class 10 bandwidth '30%'
set qos policy shaper TEST class 10 description 'test'
set qos policy shaper TEST class 10 match icmp ip protocol 'icmp'
set qos policy shaper TEST class 10 priority '1'
set qos policy shaper TEST class 10 queue-type 'fair-queue'
set qos policy shaper TEST default bandwidth '20%'
set qos policy shaper TEST default queue-type 'fq-codel'

operational commands :

show qos shaper detail
show qos shaper
show qos shaper interface ethx

tc command :

vyos@qos-test:~$  tc -s -d qdisc show dev eth0
qdisc htb 1: root refcnt 2 r2q 63 default 0xb direct_packets_stat 0 ver 3.17 direct_qlen 1000
 Sent 426 bytes 3 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 802b: parent 1:b limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 32Mb drop_batch 64
 Sent 426 bytes 3 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  maxpacket 342 drop_overlimit 0 new_flow_count 2 ecn_mark 0
  new_flows_len 1 old_flows_len 0
qdisc sfq 8029: parent 1:a limit 127p quantum 1514b depth 127 flows 128 divisor 1024
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0

Details

Version
VyOS 1.4.1
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

I've extend the test in the enviorment , it looks like there is a problem with names in our policies : eg , where it brokes the configuration :

set qos policy shaper VyOS-HTB bandwidth '100mbit'
set qos policy shaper VyOS-HTB class 10 bandwidth '30%'
set qos policy shaper VyOS-HTB class 10 description 'Prod-Class-out'
set qos policy shaper VyOS-HTB class 10 match icmp ip protocol 'icmp'
set qos policy shaper VyOS-HTB class 10 priority '1'
set qos policy shaper VyOS-HTB class 10 queue-type 'fair-queue'
set qos policy shaper VyOS-HTB class 20 bandwidth '30%'
set qos policy shaper VyOS-HTB class 20 description 'Azure-AD-Apps-Class-in'
set qos policy shaper VyOS-HTB class 20 match azure-ldap ip destination port '389'
set qos policy shaper VyOS-HTB class 20 match azure-ldap ip protocol 'tcp'
set qos policy shaper VyOS-HTB class 20 match azuread ip destination port '53'
set qos policy shaper VyOS-HTB class 20 match azuread ip protocol 'udp'
set qos policy shaper VyOS-HTB class 20 priority '2'
set qos policy shaper VyOS-HTB class 20 queue-type 'fair-queue'
set qos policy shaper VyOS-HTB class 30 bandwidth '10%'
set qos policy shaper VyOS-HTB class 30 description 'Prod-Class-in'
set qos policy shaper VyOS-HTB class 30 match address-prod-10 ip source address '10.96.96.0/20'
set qos policy shaper VyOS-HTB class 30 match address-prod-20 ip source address '10.94.0.0/22'
set qos policy shaper VyOS-HTB class 30 priority '3'
set qos policy shaper VyOS-HTB class 30 queue-type 'fair-queue'
set qos policy shaper VyOS-HTB default bandwidth '20%'
set qos policy shaper VyOS-HTB default queue-type 'fq-codel'

set qos interface eth1 egress 'VyOS-HTB'

if the name contains ( - / _) it works the op-command, but if we use names without (-/_) it works (VyOS in this case):

vyos@qos-test:~$ show qos shaper interface eth1 detail
-----------------------------------
Interface: eth1
Policy Name: VyOS

 Interface   | eth1
 Policy Name | VyOS
 Direction   | egress
 Class       | root
 Type        | htb
 Bandwidth   | 100000000
 Max. BW     | 100000000
 Bytes       | 0
 Packets     | 0
 Drops       | 0
 Queued      | 0
 Overlimit   | 0
 Requeue     | 0
 Lended      | 0
 Borrowed    | 0
 Giants      | 0

 Interface   | eth1
 Policy Name | VyOS
 Direction   | egress
 Class       | 10
 Type        | sfq
 Bandwidth   | 30000000
 Max. BW     | 30000000
 Bytes       | 0
 Packets     | 0
 Drops       | 0
 Queued      | 0
 Overlimit   | 0
 Requeue     | 0
 Lended      | 0
 Borrowed    | 0
 Giants      | 0

 Interface   | eth1
 Policy Name | VyOS
 Direction   | egress
 Class       | 20
 Type        | sfq
 Bandwidth   | 30000000
 Max. BW     | 30000000
 Bytes       | 0
 Packets     | 0
 Drops       | 0
 Queued      | 0
 Overlimit   | 0
 Requeue     | 0
 Lended      | 0
 Borrowed    | 0
 Giants      | 0

 Interface   | eth1
 Policy Name | VyOS
 Direction   | egress
 Class       | 30
 Type        | sfq
 Bandwidth   | 10000000
 Max. BW     | 10000000
 Bytes       | 0
 Packets     | 0
 Drops       | 0
 Queued      | 0
 Overlimit   | 0
 Requeue     | 0
 Lended      | 0
 Borrowed    | 0
 Giants      | 0

 Interface   | eth1
 Policy Name | VyOS
 Direction   | egress
 Class       | default
 Type        | fq_codel
 Bandwidth   | 20000000
 Max. BW     | 20000000
 Bytes       | 0
 Packets     | 0
 Drops       | 0
 Queued      | 0
 Overlimit   | 0
 Requeue     | 0
 Lended      | 0
 Borrowed    | 0
 Giants      | 0


vyos@qos-test:~$ show qos shaper interface eth1
--------------------------------------------------------------------------------
Interface: eth1
Policy Name: VyOS

Class    Type        Bandwidth     Max. BW    Bytes    Pkts    Drops    Queued
-------  --------  -----------  ----------  -------  ------  -------  --------
root     htb        100.000 Mb  100.000 Mb     0  B       0        0         0
10       sfq         30.000 Mb   30.000 Mb     0  B       0        0         0
20       sfq         30.000 Mb   30.000 Mb     0  B       0        0         0
30       sfq         10.000 Mb   10.000 Mb     0  B       0        0         0
default  fq_codel    20.000 Mb   20.000 Mb     0  B       0        0         0

It looks like the problem is in this `key_mangling', it's probably that function where these kind of errors are given:

https://github.com/vyos/vyos-1x/blob/current/src/op_mode/qos.py#L41

05

class_dict = op_mode_config_dict(['qos', 'policy', policy_type, policy_name], key_mangling=('-', '_'),
                        get_first_key=True)

I can't assign myself to this task for whatever reason, but here is a PR to correct this behavior:
https://github.com/vyos/vyos-1x/pull/4400

Will this be backported to 1.4 ahead of the 1.4.2 release?

dmbaturin renamed this task from [op-commands] show qos shaper doesn't work on vrf to "show qos shaper" doesn't work with VRFs.Thu, May 8, 11:16 AM
dmbaturin closed this task as Resolved.
dmbaturin moved this task from Backlog to Finished on the VyOS 1.4 Sagitta (1.4.3) board.
dmbaturin moved this task from Open to Finished on the VyOS 1.5 Circinus board.
dmbaturin moved this task from Need Triage to Completed on the VyOS Rolling board.