1 From 8c6c37fdc20ec9ffaa342f827a8e20afe736fb0c Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= <toke@redhat.com>
3 Date: Wed, 9 Jan 2019 17:09:44 +0100
4 Subject: [PATCH] sch_cake: Correctly update parent qlen when splitting GSO
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
10 To ensure parent qdiscs have the same notion of the number of enqueued
11 packets even after splitting a GSO packet, update the qdisc tree with the
12 number of packets that was added due to the split.
14 Reported-by: Pete Heist <pete@heistp.net>
15 Tested-by: Pete Heist <pete@heistp.net>
16 Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
17 Signed-off-by: David S. Miller <davem@davemloft.net>
18 Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
20 net/sched/sch_cake.c | 5 +++--
21 1 file changed, 3 insertions(+), 2 deletions(-)
23 --- a/net/sched/sch_cake.c
24 +++ b/net/sched/sch_cake.c
25 @@ -1666,7 +1666,7 @@ static s32 cake_enqueue(struct sk_buff *
26 if (skb_is_gso(skb) && q->rate_flags & CAKE_FLAG_SPLIT_GSO) {
27 struct sk_buff *segs, *nskb;
28 netdev_features_t features = netif_skb_features(skb);
29 - unsigned int slen = 0;
30 + unsigned int slen = 0, numsegs = 0;
32 segs = skb_gso_segment(skb, features & ~NETIF_F_GSO_MASK);
33 if (IS_ERR_OR_NULL(segs))
34 @@ -1682,6 +1682,7 @@ static s32 cake_enqueue(struct sk_buff *
35 flow_queue_add(flow, segs);
40 q->buffer_used += segs->truesize;
42 @@ -1695,7 +1696,7 @@ static s32 cake_enqueue(struct sk_buff *
43 sch->qstats.backlog += slen;
44 q->avg_window_bytes += slen;
46 - qdisc_tree_reduce_backlog(sch, 1, len);
47 + qdisc_tree_reduce_backlog(sch, 1-numsegs, len-slen);