]> git.proxmox.com Git - mirror_iproute2.git/commit
tc: use bits not mbits/sec in rate percent
authorMarcos Antonio Moraes <marcos.antonio@digirati.com.br>
Thu, 7 Feb 2019 15:29:54 +0000 (13:29 -0200)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 8 Feb 2019 17:59:45 +0000 (09:59 -0800)
commit9e46c5c2063f2f8aa775d4fa17de3a82daeea47d
treeb7da130834a567911085563c79cc72d26bf79aea
parent817204d0b0ee98b0849902e5b20cc3e84460b900
tc: use bits not mbits/sec in rate percent

As /sys/class/net/<iface>/speed indicates a value in Mbits/sec, the
conversion is necessary to create the correct limits.

This guarantees the same result for the following commands in an
1000Mbit/sec device:

tc class add ... htb rate 500Mbit
tc class add ... htb rate 50%

Fixes: 927e3cfb52b5 ("tc: B.W limits can now be specified in %.")
Signed-off-by: Marcos Antonio Moraes <marcos.antonio@digirati.com.br>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
tc/tc_util.c