]> git.baikalelectronics.ru Git - kernel.git/commit
net: netem: fix backlog accounting for corrupted GSO frames
authorJakub Kicinski <jakub.kicinski@netronome.com>
Mon, 17 Jun 2019 18:11:10 +0000 (11:11 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Jun 2019 01:30:38 +0000 (21:30 -0400)
commit7ae5da4371f7ca8b425ace096d0db27be6f42c55
tree0aaf0efa0b002eed26d9500d00dc1f31697da5e9
parenta65edd6c8e8518ff19734beab750f2062526cbb5
net: netem: fix backlog accounting for corrupted GSO frames

When GSO frame has to be corrupted netem uses skb_gso_segment()
to produce the list of frames, and re-enqueues the segments one
by one.  The backlog length has to be adjusted to account for
new frames.

The current calculation is incorrect, leading to wrong backlog
lengths in the parent qdisc (both bytes and packets), and
incorrect packet backlog count in netem itself.

Parent backlog goes negative, netem's packet backlog counts
all non-first segments twice (thus remaining non-zero even
after qdisc is emptied).

Move the variables used to count the adjustment into local
scope to make 100% sure they aren't used at any stage in
backports.

Fixes: 46e48adc14a3 ("netem: Segment GSO packets on enqueue")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_netem.c