• Eric Dumazet's avatar
    sch_tbf: handle too small burst · 4d0820cf
    Eric Dumazet authored
    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: e43ac79a ("sch_tbf: segment too big GSO packets")
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Reported-by: default avatarYang Yingliang <yangyingliang@huawei.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    4d0820cf
sch_tbf.c 12.8 KB