[Bug 2129005] Re: tc class show dev provides incorrect value for cburst
Frode Nordahl
2129005 at bugs.launchpad.net
Sun Oct 26 13:14:29 UTC 2025
The offending iproute2 commit appears to be:
commit d947f365602b30657d1b797e7464000d0ab88d5a
Author: Jonathan Lennox <jonathan.lennox42 at gmail.com>
Date: Wed Feb 26 18:53:21 2025 +0000
tc: Fix rounding in tc_calc_xmittime and tc_calc_xmitsize.
Currently, tc_calc_xmittime and tc_calc_xmitsize round from double to
int three times — once when they call tc_core_time2tick /
tc_core_tick2time (whose argument is int), once when those functions
return (their return value is int), and then finally when the tc_calc_*
functions return. This leads to extremely granular and inaccurate
conversions.
As a result, for example, on my test system (where tick_in_usec=15.625,
clock_factor=1, and hz=1000000000) for a bitrate of 1Gbps, all tc htb
burst values between 0 and 999 bytes get encoded as 0 ticks; all values
between 1000 and 1999 bytes get encoded as 15 ticks (equivalent to 960
bytes); all values between 2000 and 2999 bytes as 31 ticks (1984 bytes);
etc.
The patch changes the code so these calculations are done internally in
floating-point, and only rounded to integer values when the value is
returned. It also changes tc_calc_xmittime to round its calculated value
up, rather than down, to ensure that the calculated time is actually
sufficient for the requested size.
Signed-off-by: Jonathan Lennox <jonathan.lennox at 8x8.com>
Signed-off-by: David Ahern <dsahern at kernel.org>
It looks like a deliberate change of behavior.
--
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to ovn in Ubuntu.
https://bugs.launchpad.net/bugs/2129005
Title:
tc class show dev provides incorrect value for cburst
Status in iproute2 package in Ubuntu:
New
Status in ovn package in Ubuntu:
New
Bug description:
As detected by the ovn system testsuite the following test fails when
upgrading iprotue2 from 6.14 to more recent versions:
egress qos
The command being executed by the testsuite is:
tc class show dev ovs-public
And the printed value becomes:
class htb 1:2 parent 1:fffe prio 0 rate 12Kbit ceil 34359Mbit
burst 375000b cburst 374933b
While the expected output is:
class htb 1:2 parent 1:fffe prio 0 rate 12Kbit ceil 34359Mbit
burst 375000b cburst 373662b
The issue appears to be present in iproute2 versions 6.17.0-1,
6.16.0-1ubuntu2
Downgrading to 6.14.0-1ubuntu1 makes the problem go away.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/iproute2/+bug/2129005/+subscriptions
More information about the Ubuntu-openstack-bugs
mailing list