<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vyos-1x.git/python/vyos/qos, branch 1.4.0-epa2</title>
<subtitle>VyOS command definitions, scripts, and utilities (mirror of https://github.com/marekm72/vyos-1x.git)
</subtitle>
<id>https://git.amelek.net/marekm72/vyos-1x.git/atom?h=1.4.0-epa2</id>
<link rel='self' href='https://git.amelek.net/marekm72/vyos-1x.git/atom?h=1.4.0-epa2'/>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-1x.git/'/>
<updated>2024-03-04T17:27:51+00:00</updated>
<entry>
<title>T5646: Skip add filter for qos policy limiter class without match</title>
<updated>2024-03-04T17:27:51+00:00</updated>
<author>
<name>Nataliia Solomko</name>
<email>natalirs1985@gmail.com</email>
</author>
<published>2024-03-01T10:47:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-1x.git/commit/?id=b0a4e646b4179ac51f937f40cf865b933afb6370'/>
<id>urn:sha1:b0a4e646b4179ac51f937f40cf865b933afb6370</id>
<content type='text'>
(cherry picked from commit 2104424c1a43dc027567e051262e1eed6506491f)
</content>
</entry>
<entry>
<title>qos: T6081: QoS policy shaper target and interval wrong calcuations</title>
<updated>2024-03-01T21:28:30+00:00</updated>
<author>
<name>Nataliia Solomko</name>
<email>natalirs1985@gmail.com</email>
</author>
<published>2024-03-01T15:51:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-1x.git/commit/?id=21f9892d0840974b6d54e5746feb3c572dd907bf'/>
<id>urn:sha1:21f9892d0840974b6d54e5746feb3c572dd907bf</id>
<content type='text'>
(cherry picked from commit c7f5b510cfd117e57f2d22e259c843600ef4cc76)
</content>
</entry>
<entry>
<title>T6028: Fix QoS policy shaper wrong class_id_max and default_minor_id</title>
<updated>2024-02-09T11:44:35+00:00</updated>
<author>
<name>Viacheslav Hletenko</name>
<email>v.gletenko@vyos.io</email>
</author>
<published>2024-02-09T10:51:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-1x.git/commit/?id=a6781cd008998200d491fbf86f6976d81323a7bd'/>
<id>urn:sha1:a6781cd008998200d491fbf86f6976d81323a7bd</id>
<content type='text'>
The `class_id_max` is wrong due to `tmp.sort` of Strings
If we have class 5 and class 10 we get sorted max value 5, expected 10

```
&gt;&gt;&gt; tmp = ['5', '10']
&gt;&gt;&gt; tmp.sort()
&gt;&gt;&gt; tmp
['10', '5']
&gt;&gt;&gt;

&gt;&gt;&gt; hex(5+1)
'0x6'
&gt;&gt;&gt;
&gt;&gt;&gt; hex(10+1)
'0xb'
&gt;&gt;&gt;
```

This way we get wrong default maximum class value:
```
tc qdisc replace dev eth1 root handle 1: htb r2q 444 default 6
```
Expect:
```
tc qdisc replace dev eth1 root handle 1: htb r2q 444 default b
```

Fix this converting Strings to Integers and get max value.

(cherry picked from commit 2e8fa45c7f0663549edd118622b3381e7c428b2e)
</content>
</entry>
<entry>
<title>T6021: Fix QoS shaper r2q calculation</title>
<updated>2024-02-07T17:02:13+00:00</updated>
<author>
<name>Viacheslav Hletenko</name>
<email>v.gletenko@vyos.io</email>
</author>
<published>2024-02-07T16:34:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-1x.git/commit/?id=6c3c5389bdd3f6b9d40e53596f9f22a2a36bfee9'/>
<id>urn:sha1:6c3c5389bdd3f6b9d40e53596f9f22a2a36bfee9</id>
<content type='text'>
The current calculation `r2q` is wrong as it uses `Floor division`
but expecting `division`
This way `math.ceil` calculate wrong value as we expect
round a number upward to its nearest integer

For example for speed 710 mbits expected value `444` but we get `443`

```
from math import ceil

MAXQUANTUM = 200000
speed = 710000000
speed_bps = int(speed) // 8

&gt;&gt;&gt; speed_bps // MAXQUANTUM
443
&gt;&gt;&gt; speed_bps / MAXQUANTUM
443.75
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; ceil(speed_bps // MAXQUANTUM)
443
&gt;&gt;&gt; ceil(speed_bps / MAXQUANTUM)
444
&gt;&gt;&gt;
```

(cherry picked from commit ce1035e1e8642bf740e2a21693a72fe2127b8f72)
</content>
</entry>
<entry>
<title>qos: T5848: Add triple-isolate option to CAKE policy config</title>
<updated>2024-02-02T12:12:02+00:00</updated>
<author>
<name>Matthew Kobayashi</name>
<email>matthew@kobayashi.au</email>
</author>
<published>2023-12-22T01:50:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-1x.git/commit/?id=628877a46a049142cffd5d98de74f652d4a9dde7'/>
<id>urn:sha1:628877a46a049142cffd5d98de74f652d4a9dde7</id>
<content type='text'>
(cherry picked from commit 61342083d7db8c30d015474fae5cb71f480487d8)
</content>
</entry>
<entry>
<title>T5974: Fix QoS shape bandwidth and ceil calculation for default</title>
<updated>2024-02-01T16:03:36+00:00</updated>
<author>
<name>Viacheslav Hletenko</name>
<email>v.gletenko@vyos.io</email>
</author>
<published>2024-01-23T10:53:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-1x.git/commit/?id=050b2eb42b0356ff446fe6fed1be4bad1f754f77'/>
<id>urn:sha1:050b2eb42b0356ff446fe6fed1be4bad1f754f77</id>
<content type='text'>
The default `bandwidth` and `ceiling` should calculate values
based on &lt;tag&gt; bandwidth but currently it gets the value from
qos.base `/sys/class/net/{self._interface}/speed`

```
set qos policy shaper SHAPER bandwidth '20mbit'
set qos policy shaper SHAPER default bandwidth '95%'
set qos policy shaper SHAPER default ceiling '100%'
```

It causes wrong calculations for class `default` i.e
950Mbit for bandwidth (expected 95% of bandwidth, 19Mbit)
1Gbit for ceil (expected 100% of bandwidth, 20Mbit)

Gets incorrect values
```
r4# tc class show dev eth1
class htb 1:1 root rate 20Mbit ceil 20Mbit burst 1600b cburst 1600b
class htb 1:a parent 1:1 leaf 8053: prio 0 rate 200Kbit ceil 200Kbit burst 1Mb cburst 1600b
class htb 1:b parent 1:1 leaf 8054: prio 7 rate 950Mbit ceil 1Gbit burst 15200b cburst 1375b
```

Fix this

(cherry picked from commit 6ddfe6328e1cbdde1b70763b39e3a87f8374755a)
</content>
</entry>
<entry>
<title>T5958: QoS add basic implementation of policy shaper-hfsc</title>
<updated>2024-01-22T11:22:35+00:00</updated>
<author>
<name>Viacheslav Hletenko</name>
<email>v.gletenko@vyos.io</email>
</author>
<published>2024-01-18T19:26:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-1x.git/commit/?id=8362b19bbfac3cc41d3fe5b85e43a0d9374b98a8'/>
<id>urn:sha1:8362b19bbfac3cc41d3fe5b85e43a0d9374b98a8</id>
<content type='text'>
QoS policy shaper-hfsc was not implemented after rewriting the
traffic-policy to qos policy. We had CLI but it  does not use the
correct class. Add a basic implementation of policy shaper-hfsc.
Write the class `TrafficShaperHFS`

(cherry picked from commit f6b6ee636e34f98d336ee53599666afd1f395d78)
</content>
</entry>
<entry>
<title>T5961: Fix QoS policy shaper class match vif</title>
<updated>2024-01-21T12:23:17+00:00</updated>
<author>
<name>Viacheslav Hletenko</name>
<email>v.gletenko@vyos.io</email>
</author>
<published>2024-01-20T15:01:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-1x.git/commit/?id=7f277e0e93cac0678ef101f0c36d1a916ec778b0'/>
<id>urn:sha1:7f277e0e93cac0678ef101f0c36d1a916ec778b0</id>
<content type='text'>
If we have QoS policy shaper class match `vif` (VLAN) we have to
use `basic match "meta(vlan mask 0xfff eq xxx)` instead of
`action policy`

Actual incorrect TC filter:
tc filter add dev eth1 parent 1: protocol all prio 1 action police rate 100000000 burst 15k flowid 1:64

The correct TC filter after fix:
tc filter add dev eth1 parent 1: protocol all prio 1 basic match "meta(vlan mask 0xfff eq 100)" flowid 1:64

(cherry picked from commit bb532f7f65930f8bc42e3bf3ebbcc690bffcfd0a)
</content>
</entry>
<entry>
<title>T5963: Fix QoS shaper rate calculations and set defaul 1Gbit</title>
<updated>2024-01-20T09:04:49+00:00</updated>
<author>
<name>Viacheslav Hletenko</name>
<email>v.gletenko@vyos.io</email>
</author>
<published>2024-01-19T13:21:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-1x.git/commit/?id=885a6335a50e63a0b9cc8d1e716150518bf19025'/>
<id>urn:sha1:885a6335a50e63a0b9cc8d1e716150518bf19025</id>
<content type='text'>
It is impossible to detect interface speed for some devices
for exmaple virtio interfaces:
```
vyos@r4:~$ cat /sys/class/net/eth1/speed
-1
```

It causes wrong negative calcultaions like:
 - bandwidth: -1000000
 - 4% of bandwidth: -40000

tc class replace dev eth1 parent 1: classid 1:1 htb rate -1000000
tc class replace dev eth1 parent 1:1 classid 1:a htb rate -40000

Fix this with checking negative value.
Add default interface speed to 1000 Mbit if we cannot detect the
interface speed, the current default value 10 Mbit is too low
for nowadays

(cherry picked from commit a7fe02e989cf7034609cb833c86143660eb609d5)
</content>
</entry>
<entry>
<title>T5299: Add missed option ceiling for QoS shaper</title>
<updated>2023-10-22T16:54:26+00:00</updated>
<author>
<name>Viacheslav Hletenko</name>
<email>v.gletenko@vyos.io</email>
</author>
<published>2023-10-22T13:15:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-1x.git/commit/?id=7fdf77b6b339bc12f1104b2d84945a82119c0eb4'/>
<id>urn:sha1:7fdf77b6b339bc12f1104b2d84945a82119c0eb4</id>
<content type='text'>
Add missed option `ceil` for QoS class 'trafficshaper'

(cherry picked from commit 5218241e6293317f8837b3f7c3893d653d960993)
</content>
</entry>
</feed>
