diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2013-12-10 14:59:27 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-11 15:08:41 -0500 |
commit | cc106e441a63bec3b1cb72948df82ea15945c449 (patch) | |
tree | be4ee6109410b1613b0f465b94cca6dbb87a1561 /net/sched/sch_choke.c | |
parent | 4bd7b5127bd02c12c1cc837a7a0b6ce295eb2505 (diff) | |
download | linux-cc106e441a63bec3b1cb72948df82ea15945c449.tar.bz2 |
net: sched: tbf: fix the calculation of max_size
Current max_size is caluated from rate table. Now, the rate table
has been replaced and it's wrong to caculate max_size based on this
rate table. It can lead wrong calculation of max_size.
The burst in kernel may be lower than user asked, because burst may gets
some loss when transform it to buffer(E.g. "burst 40kb rate 30mbit/s")
and it seems we cannot avoid this loss. Burst's value(max_size) based on
rate table may be equal user asked. If a packet's length is max_size, this
packet will be stalled in tbf_dequeue() because its length is above the
burst in kernel so that it cannot get enough tokens. The max_size guards
against enqueuing packet sizes above q->buffer "time" in tbf_enqueue().
To make consistent with the calculation of tokens, this patch add a helper
psched_ns_t2l() to calculate burst(max_size) directly to fix this problem.
After this fix, we can support to using 64bit rates to calculate burst as well.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_choke.c')
0 files changed, 0 insertions, 0 deletions