]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net/sched: tbf: correct backlog statistic for GSO packets
authorMartin Ottens <martin.ottens@fau.de>
Mon, 25 Nov 2024 17:46:07 +0000 (18:46 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 30 Nov 2024 21:02:43 +0000 (13:02 -0800)
commit1596a135e3180c92e42dd1fbcad321f4fb3e3b17
tree06370e39a9eb2c8ad524f5896ff34eb7723e3611
parent98337d7c87577ded71114f6976edb70a163e27bc
net/sched: tbf: correct backlog statistic for GSO packets

When the length of a GSO packet in the tbf qdisc is larger than the burst
size configured the packet will be segmented by the tbf_segment function.
Whenever this function is used to enqueue SKBs, the backlog statistic of
the tbf is not increased correctly. This can lead to underflows of the
'backlog' byte-statistic value when these packets are dequeued from tbf.

Reproduce the bug:
Ensure that the sender machine has GSO enabled. Configured the tbf on
the outgoing interface of the machine as follows (burstsize = 1 MTU):
$ tc qdisc add dev <oif> root handle 1: tbf rate 50Mbit burst 1514 latency 50ms

Send bulk TCP traffic out via this interface, e.g., by running an iPerf3
client on this machine. Check the qdisc statistics:
$ tc -s qdisc show dev <oif>

The 'backlog' byte-statistic has incorrect values while traffic is
transferred, e.g., high values due to u32 underflows. When the transfer
is stopped, the value is != 0, which should never happen.

This patch fixes this bug by updating the statistics correctly, even if
single SKBs of a GSO SKB cannot be enqueued.

Fixes: e43ac79a4bc6 ("sch_tbf: segment too big GSO packets")
Signed-off-by: Martin Ottens <martin.ottens@fau.de>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20241125174608.1484356-1-martin.ottens@fau.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/sched/sch_tbf.c