HTB - wrong rate estimation in a gigabit network

Dino Ravnic <[email protected]> Sun, 15 Nov 2020 13:43:52 +0000
Newsgroups org.kernel.vger.lartc
Message-ID <CAN0yqhMGq=RYvrDKXZ1yrefmTotJrX3RzB2RZ=TBxWrKR3Ct+A@mail.gmail.com>
Hi all!

I have a question regarding HTB and setting rate in a gigabit network.
Issue is that full speed cannot be achieved when using HTB.

Network speed is 2.2Gbit and through HTB it goes only up to 1.4Gbit.

I was able to work around this issue by offsetting i.e. choosing a
higher rate than my network speed (4Gbit) which then allowed my full
speed (2.2Gbit). This higher rate was calculated by benchmarking. It's
a minimum rate at which I could get full speed through HTB.

Here is a simpler version of my setup used for debugging this issue:

tc qdisc  del dev eth0 root
tc qdisc  add dev eth0 root             handle 1:       htb default 100
tc class  add dev eth0 parent 1:1       classid 1:100   htb rate
4000mbit ceil 4000mbit
tc qdisc  add dev eth0 parent 1:100     handle 100:     sfq


Note that I'm using an older kernel, it seems this issue was detected
and fixed here:
https://github.com/torvalds/linux/commit/1c0d32fde5bdf1184bc274f864c09799278a1114

I will upgrade the kernel, but wanted to check if this workaround
makes sense in the meantime?

Thanks,
Dino