]> git.baikalelectronics.ru Git - kernel.git/commit
sch_tbf: handle too small burst
authorEric Dumazet <edumazet@google.com>
Sat, 23 Nov 2013 20:59:20 +0000 (12:59 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 23 Nov 2013 22:46:25 +0000 (14:46 -0800)
commit8f0c33d250e314e0a13fa5203e2fdc107c82377c
tree3b390515d5e298866f9f00b611adc821a4137676
parent1ebfca9f2ce0274f7b3bc1e1c5830f8828f27464
sch_tbf: handle too small burst

If a too small burst is inadvertently set on TBF, we might trigger
a bug in tbf_segment(), as 'skb' instead of 'segs' was used in a
qdisc_reshape_fail() call.

tc qdisc add dev eth0 root handle 1: tbf latency 50ms burst 1KB rate
50mbit

Fix the bug, and add a warning, as such configuration is not
going to work anyway for non GSO packets.

(For some reason, one has to use a burst >= 1520 to get a working
configuration, even with old kernels. This is a probable iproute2/tc
bug)

Based on a report and initial patch from Yang Yingliang

Fixes: 1bd05f6d9b22 ("sch_tbf: segment too big GSO packets")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_tbf.c