summaryrefslogtreecommitdiff
path: root/python/vyos/qos/base.py
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2024-05-02 17:18:09 +0200
committerGitHub <noreply@github.com>2024-05-02 17:18:09 +0200
commit94912486be3ce4a0338d9a3e1fffa4a8cfe8f52b (patch)
treed964cfd4f27e741da6eabe25967c47c9572df31e /python/vyos/qos/base.py
parenta6cc2b4ccbcbf4b427b68000e4b31b9bd95a1d64 (diff)
parentabc465f8ad894fda29d32b053798676e0294e20f (diff)
downloadvyos-1x-94912486be3ce4a0338d9a3e1fffa4a8cfe8f52b.tar.gz
vyos-1x-94912486be3ce4a0338d9a3e1fffa4a8cfe8f52b.zip
Merge pull request #3401 from vyos/mergify/bp/sagitta/pr-3400
qos: T6225: Fix QoS random-detect policy (backport #3400)
Diffstat (limited to 'python/vyos/qos/base.py')
-rw-r--r--python/vyos/qos/base.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/vyos/qos/base.py b/python/vyos/qos/base.py
index 4173a1a43..87927ba9d 100644
--- a/python/vyos/qos/base.py
+++ b/python/vyos/qos/base.py
@@ -90,13 +90,14 @@ class QoSBase:
else:
return value
- def _calc_random_detect_queue_params(self, avg_pkt, max_thr, limit=None, min_thr=None, mark_probability=None):
+ def _calc_random_detect_queue_params(self, avg_pkt, max_thr, limit=None, min_thr=None,
+ mark_probability=None, precedence=0):
params = dict()
avg_pkt = int(avg_pkt)
max_thr = int(max_thr)
mark_probability = int(mark_probability)
limit = int(limit) if limit else 4 * max_thr
- min_thr = int(min_thr) if min_thr else (9 * max_thr) // 18
+ min_thr = int(min_thr) if min_thr else ((9 + precedence) * max_thr) // 18
params['avg_pkt'] = avg_pkt
params['limit'] = limit * avg_pkt