summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2023-08-08 10:39:27 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2023-08-08 10:39:27 +0000
commit7632b7446ec45d2444cb3ccfb075c8e8b2df31b0 (patch)
treedb97281ab2994a8258b43ff392c4fa461ffcec47 /python
parent69f983d45716683d0ce41bf094cf53548395717f (diff)
downloadvyos-1x-7632b7446ec45d2444cb3ccfb075c8e8b2df31b0.tar.gz
vyos-1x-7632b7446ec45d2444cb3ccfb075c8e8b2df31b0.zip
T4989: QoS fix policer match mark
Diffstat (limited to 'python')
-rw-r--r--python/vyos/qos/base.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/python/vyos/qos/base.py b/python/vyos/qos/base.py
index 1eac0d1ee..d8bbfe970 100644
--- a/python/vyos/qos/base.py
+++ b/python/vyos/qos/base.py
@@ -298,6 +298,27 @@ class QoSBase:
filter_cmd += f' flowid {self._parent:x}:{cls:x}'
self._cmd(filter_cmd)
+ if any(tmp in ['exceed', 'bandwidth', 'burst'] for tmp in cls_config):
+ filter_cmd += f' action police'
+
+ if 'exceed' in cls_config:
+ action = cls_config['exceed']
+ filter_cmd += f' conform-exceed {action}'
+ if 'not_exceed' in cls_config:
+ action = cls_config['not_exceed']
+ filter_cmd += f'/{action}'
+
+ if 'bandwidth' in cls_config:
+ rate = self._rate_convert(cls_config['bandwidth'])
+ filter_cmd += f' rate {rate}'
+
+ if 'burst' in cls_config:
+ burst = cls_config['burst']
+ filter_cmd += f' burst {burst}'
+ cls = int(cls)
+ filter_cmd += f' flowid {self._parent:x}:{cls:x}'
+ self._cmd(filter_cmd)
+
else:
filter_cmd += ' basic'