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

qos: T4248: Allow to remove the only rule from the qos class #3316

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

HollyGurza
Copy link
Contributor

Change Summary

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)

Related PR(s)

Component(s) name

Proposed changes

How to test

single rule:

set qos interface eth0 egress qos-shaper-eth0
set qos policy shaper qos-shaper-eth0 bandwidth 10mbit
set qos policy shaper qos-shaper-eth0 default bandwidth 100mbit
set qos policy shaper qos-shaper-eth0 default burst 100
set qos policy shaper qos-shaper-eth0 class 30 bandwidth 50mbit
set qos policy shaper qos-shaper-eth0 class 30 ceiling 5mbit
set qos policy shaper qos-shaper-eth0 class 30 match ADDRESS30 ip source address 10.1.1.0/24
set qos policy shaper qos-shaper-eth0 class 30 priority 5
set qos policy shaper qos-shaper-eth0 class 30 queue-type fair-queue
commit
del qos policy shaper qos-shaper-eth0 class 30 match ADDRESS30 ip source address 10.1.1.0/24
commit

two rules:

conf
set qos interface eth1 egress MY-HTB
set qos policy shaper MY-HTB default bandwidth '10mbit'
set qos policy shaper MY-HTB class 40 bandwidth '90%'
set qos policy shaper MY-HTB class 40 ceiling '100%'
set qos policy shaper MY-HTB class 40 match ADDRESS40 ip source address '10.2.1.0/24'
set qos policy shaper MY-HTB class 40 match ADDRESS40 ip dscp CS4
set qos policy shaper MY-HTB class 40 priority '5'
set qos policy shaper MY-HTB class 40 queue-type 'fair-queue'
commit
del qos policy shaper MY-HTB class 40 match ADDRESS40 ip source address '10.2.1.0/24'
commit
del qos policy shaper MY-HTB class 40 match ADDRESS40 ip dscp CS4
commit

Smoketest result

vyos@vyos:~$ python3 /usr/libexec/vyos/tests/smoke/cli/test_qos.py 
test_01_cake (__main__.TestQoS.test_01_cake) ... ok
test_02_drop_tail (__main__.TestQoS.test_02_drop_tail) ... 
Selected QoS policy "qos-policy-eth0" does not exist!

ok
test_03_fair_queue (__main__.TestQoS.test_03_fair_queue) ... 
Selected QoS policy "qos-policy-eth0" does not exist!

ok
test_04_fq_codel (__main__.TestQoS.test_04_fq_codel) ... 
Selected QoS policy "qos-policy-eth0" does not exist!

ok
test_05_limiter (__main__.TestQoS.test_05_limiter) ... 
Selected QoS policy "qos-policy-eth0" does not exist!

ok
test_06_network_emulator (__main__.TestQoS.test_06_network_emulator) ... 
Selected QoS policy "qos-policy-eth0" does not exist!

ok
test_07_priority_queue (__main__.TestQoS.test_07_priority_queue) ... 
Selected QoS policy "qos-policy-eth0" does not exist!

ok
test_08_random_detect (__main__.TestQoS.test_08_random_detect) ... skipped 'tc returns invalid JSON here - needs iproute2 fix'
test_09_rate_control (__main__.TestQoS.test_09_rate_control) ... 
Selected QoS policy "qos-policy-eth0" does not exist!

ok
test_10_round_robin (__main__.TestQoS.test_10_round_robin) ... 
Selected QoS policy "qos-policy-eth0" does not exist!

ok
test_11_shaper (__main__.TestQoS.test_11_shaper) ... ok
test_12_shaper_with_red_queue (__main__.TestQoS.test_12_shaper_with_red_queue) ... ok
test_13_shaper_delete_only_rule (__main__.TestQoS.test_13_shaper_delete_only_rule) ... ok

----------------------------------------------------------------------
Ran 13 tests in 41.900s

OK (skipped=1)

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, sever-sever and c-po and removed request for a team April 16, 2024 08:00
@@ -70,6 +70,22 @@ def get_shaper(qos, interface_config, direction):

return (map_vyops_tc[shaper_type], shaper_config)


def _clean_conf_dict(conf):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually wonder, if this can be generalized @jestabro?

@dmbaturin dmbaturin merged commit b8c5c0c into vyos:current Apr 25, 2024
9 checks passed
@dmbaturin
Copy link
Member

@Mergifyio backport sagitta

Copy link
Contributor

mergify bot commented Apr 25, 2024

backport sagitta

✅ Backports have been created

c-po added a commit that referenced this pull request Apr 26, 2024
qos: T4248: Allow to remove the only rule from the qos class (backport #3316)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants