diff options
author | khramshinr <khramshinr@gmail.com> | 2024-11-11 10:04:15 +0800 |
---|---|---|
committer | khramshinr <khramshinr@gmail.com> | 2024-12-11 09:32:37 +0800 |
commit | 99feb3bbe88a3ed96ec5d6dd741689f30a385693 (patch) | |
tree | e4ac6beba05a46656bdace0e75070e04c213a771 /python | |
parent | 3ed6f02a66fd9d02a4cc3c45b2605cb3d8ad0d2e (diff) | |
download | vyos-1x-99feb3bbe88a3ed96ec5d6dd741689f30a385693.tar.gz vyos-1x-99feb3bbe88a3ed96ec5d6dd741689f30a385693.zip |
T6790: QoS: Improve CAKE Policy
- Fixed handling of flow isolation parameters.
- Corrected support for `nat` and `nonat` in flow isolation.
- Extended RTT values to cover the full range supported by `tc`.
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/qos/base.py | 6 | ||||
-rw-r--r-- | python/vyos/qos/priority.py | 19 |
2 files changed, 13 insertions, 12 deletions
diff --git a/python/vyos/qos/base.py b/python/vyos/qos/base.py index 12d940e3c..3da9afe04 100644 --- a/python/vyos/qos/base.py +++ b/python/vyos/qos/base.py @@ -164,11 +164,11 @@ class QoSBase: default_tc += f' red' qparams = self._calc_random_detect_queue_params( - avg_pkt=dict_search('average_packet', config), - max_thr=dict_search('maximum_threshold', config), + avg_pkt=dict_search('average_packet', config) or 1024, + max_thr=dict_search('maximum_threshold', config) or 18, limit=dict_search('queue_limit', config), min_thr=dict_search('minimum_threshold', config), - mark_probability=dict_search('mark_probability', config) + mark_probability=dict_search('mark_probability', config) or 10 ) default_tc += f' limit {qparams["limit"]} avpkt {qparams["avg_pkt"]}' diff --git a/python/vyos/qos/priority.py b/python/vyos/qos/priority.py index 7f0a67032..66d27a639 100644 --- a/python/vyos/qos/priority.py +++ b/python/vyos/qos/priority.py @@ -20,17 +20,18 @@ class Priority(QoSBase): # https://man7.org/linux/man-pages/man8/tc-prio.8.html def update(self, config, direction): - if 'class' in config: - class_id_max = self._get_class_max_id(config) - bands = int(class_id_max) +1 + class_id_max = self._get_class_max_id(config) + class_id_max = class_id_max if class_id_max else 1 + bands = int(class_id_max) + 1 - tmp = f'tc qdisc add dev {self._interface} root handle {self._parent:x}: prio bands {bands} priomap ' \ - f'{class_id_max} {class_id_max} {class_id_max} {class_id_max} ' \ - f'{class_id_max} {class_id_max} {class_id_max} {class_id_max} ' \ - f'{class_id_max} {class_id_max} {class_id_max} {class_id_max} ' \ - f'{class_id_max} {class_id_max} {class_id_max} {class_id_max} ' - self._cmd(tmp) + tmp = f'tc qdisc add dev {self._interface} root handle {self._parent:x}: prio bands {bands} priomap ' \ + f'{class_id_max} {class_id_max} {class_id_max} {class_id_max} ' \ + f'{class_id_max} {class_id_max} {class_id_max} {class_id_max} ' \ + f'{class_id_max} {class_id_max} {class_id_max} {class_id_max} ' \ + f'{class_id_max} {class_id_max} {class_id_max} {class_id_max} ' + self._cmd(tmp) + if 'class' in config: for cls in config['class']: cls = int(cls) tmp = f'tc qdisc add dev {self._interface} parent {self._parent:x}:{cls:x} pfifo' |