diff options
author | Christian Breunig <christian@breunig.cc> | 2023-08-08 13:56:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-08 13:56:42 +0200 |
commit | 0e92ee262d8ec6ee88d7331f2cbffe8b6b689437 (patch) | |
tree | db97281ab2994a8258b43ff392c4fa461ffcec47 | |
parent | 69f983d45716683d0ce41bf094cf53548395717f (diff) | |
parent | 7632b7446ec45d2444cb3ccfb075c8e8b2df31b0 (diff) | |
download | vyos-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.py | 21 |
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' |