Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T5256: T5195: Fix QoS match protocol and add vyos.utils.network #2047

Merged
merged 2 commits into from Jun 17, 2023

Conversation

sever-sever
Copy link
Member

@sever-sever sever-sever commented Jun 17, 2023

Change Summary

  1. Add vyos.utils.network

  2. tc filter expects protocol number for the match instead of the protocol name

vyos@r14# sudo tc filter replace dev eth0 parent 1: protocol all u32 match ip sport 53 0xffff match ip protocol icmp 0xff flowid 1:17
Illegal "match"
[edit]
vyos@r14# 
[edit]
vyos@r14# sudo tc filter replace dev eth0 parent 1: protocol all u32 match ip sport 53 0xffff match ip protocol 1 0xff flowid 1:17
[edit]
vyos@r14# 

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Component(s) name

Proposed changes

How to test

VyOS config:

set qos interface eth0 egress 'test'
set qos policy shaper test bandwidth '330mbit'
set qos policy shaper test class 23 match 10 ip protocol 'icmp'
set qos policy shaper test class 23 match 10 ip source port '53'
set qos policy shaper test default bandwidth '20mbit'
set qos policy shaper test default ceiling '30mbit'
set qos policy shaper test default queue-type 'fair-queue'

Before fix:

    raise OSError(code, feedback)
PermissionError: [Errno 1] failed to run command: tc filter replace dev eth0 parent 1: protocol all u32 match ip sport 53 0xffff match ip protocol icmp 0xff flowid 1:17
returned: 
exit code: 1

After the fix:

{'bandwidth': '330mbit',
 'class': {'23': {'bandwidth': 'auto',
                  'burst': '15k',
                  'codel_quantum': '1514',
                  'flows': '1024',
                  'interval': '100',
                  'match': {'10': {'ip': {'protocol': 'icmp',
                                          'source': {'port': '53'}}}},
                  'queue_type': 'fq-codel',
                  'target': '5'}},
 'default': {'bandwidth': '20mbit',
             'burst': '15k',
             'ceiling': '30mbit',
             'codel_quantum': '1514',
             'flows': '1024',
             'interval': '100',
             'priority': '20',
             'queue_type': 'fair-queue',
             'target': '5'}}

DEBUG/QoS: tc qdisc replace dev eth0 root handle 1: htb r2q 206 default 18
DEBUG/QoS: tc class replace dev eth0 parent 1: classid 1:1 htb rate 330000000
DEBUG/QoS: tc class replace dev eth0 parent 1:1 classid 1:17 htb rate -1000000 burst 15k quantum 1514
DEBUG/QoS: tc qdisc replace dev eth0 parent 1:17 sfq
DEBUG/QoS: tc class replace dev eth0 parent 1:1 classid 1:18 htb rate 20000000 burst 15k quantum 1514 prio 20
DEBUG/QoS: tc qdisc replace dev eth0 parent 1:18 sfq
DEBUG/QoS: tc qdisc replace dev eth0 parent 1:17 fq_codel quantum 1514 flows 1024 interval 100 interval 100 target 5 noecn
DEBUG/QoS: tc filter replace dev eth0 parent 1: protocol all u32 match ip sport 53 0xffff match ip protocol 1 0xff flowid 1:17

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, zdc, jestabro and c-po and removed request for a team June 17, 2023 15:00
@c-po c-po merged commit fb452c7 into vyos:current Jun 17, 2023
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants