]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tbf: fix latency printing
authorPatrick McHardy <kaber@trash.net>
Sun, 4 Mar 2007 19:14:55 +0000 (20:14 +0100)
committerStephen Hemminger <shemminger@linux-foundation.org>
Tue, 13 Mar 2007 21:42:13 +0000 (14:42 -0700)
[IPROUTE]: tbf: fix latency printing

The calculated latency is already in usecs, the additional tick2usec
conversion breaks the calculation with jiffies or tsc clock source.

Example:

# tc qdisc add dev dummy0 root tbf latency 20ms burst 10k rate 50mbit
# tc qdisc show dev dummy0
qdisc tbf 8002: rate 50000Kbit burst 10Kb lat 15.4ms

Fixed:

# tc qdisc show dev dummy0
qdisc tbf 8002: rate 50000Kbit burst 10Kb lat 20ms

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
tc/q_tbf.c

index b8251cb3accebcdb4674aff8af957f6ca70cfe33..b50519fe4534cf130f21ff5cd59979960d6e82f4 100644 (file)
@@ -251,7 +251,7 @@ static int tbf_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
                if (lat2 > latency)
                        latency = lat2;
        }
-       fprintf(f, "lat %s ", sprint_usecs(tc_core_tick2usec(latency), b1));
+       fprintf(f, "lat %s ", sprint_usecs(latency, b1));
 
        return 0;
 }