summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-08-08 13:56:42 +0200
committerGitHub <noreply@github.com>2023-08-08 13:56:42 +0200
commit0e92ee262d8ec6ee88d7331f2cbffe8b6b689437 (patch)
treedb97281ab2994a8258b43ff392c4fa461ffcec47
parent69f983d45716683d0ce41bf094cf53548395717f (diff)
parent7632b7446ec45d2444cb3ccfb075c8e8b2df31b0 (diff)
downloadvyos-1x-0e92ee262d8ec6ee88d7331f2cbffe8b6b689437.tar.gz
vyos-1x-0e92ee262d8ec6ee88d7331f2cbffe8b6b689437.zip
Merge pull request #2138 from sever-sever/T4989
T4989: QoS fix policer match mark
-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'