summaryrefslogtreecommitdiffstats
path: root/lib/route/tc.c
diff options
context:
space:
mode:
authorAndrew Collins <bsderandrew@gmail.com>2012-05-26 00:08:06 (GMT)
committerThomas Graf <tgraf@redhat.com>2012-05-29 09:42:48 (GMT)
commit970f5d0221863b1473740455ca4d8cefcb34ff31 (patch)
tree4d5081a4f375c0949640da790fbdbf357431e7c0 /lib/route/tc.c
parent9bb30a5e801fff2333d9b847be42294aa2e34e06 (diff)
downloadlibnl-970f5d0221863b1473740455ca4d8cefcb34ff31.zip
libnl-970f5d0221863b1473740455ca4d8cefcb34ff31.tar.gz
libnl-970f5d0221863b1473740455ca4d8cefcb34ff31.tar.bz2
correct HTB rtable/HZ calculations
The HTB implementation in libnl uses units of microseconds in a number of places where it seems TC is expecting time in units of ticks, which causes actual rates much higher than requested. Additionally, libnl uses USER_HZ for calculating buffer and cbuffer sizes, which can result in much larger buffers than necessary on systems with high resolution timers. Note that the TBF qdisc uses microseconds incorrectly in two spots as well, I fixed this but did not test.
Diffstat (limited to 'lib/route/tc.c')
-rw-r--r--lib/route/tc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/route/tc.c b/lib/route/tc.c
index 6826a05..6c72c15 100644
--- a/lib/route/tc.c
+++ b/lib/route/tc.c
@@ -710,7 +710,7 @@ int rtnl_tc_build_rate_table(struct rtnl_tc *tc, struct rtnl_ratespec *spec,
for (i = 0; i < RTNL_TC_RTABLE_SIZE; i++) {
size = adjust_size((i + 1) << cell_log, spec->rs_mpu, linktype);
- dst[i] = rtnl_tc_calc_txtime(size, spec->rs_rate);
+ dst[i] = nl_us2ticks(rtnl_tc_calc_txtime(size, spec->rs_rate));
}
spec->rs_cell_align = -1;