f6de44568a00829ed444aaf320739eadd1d3e719
[openwrt/staging/rmilecki.git] /
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
5 packets
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
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.
13
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>
19 ---
20 net/sched/sch_cake.c | 5 +++--
21 1 file changed, 3 insertions(+), 2 deletions(-)
22
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;
31
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);
36
37 sch->q.qlen++;
38 + numsegs++;
39 slen += segs->len;
40 q->buffer_used += segs->truesize;
41 b->packets++;
42 @@ -1695,7 +1696,7 @@ static s32 cake_enqueue(struct sk_buff *
43 sch->qstats.backlog += slen;
44 q->avg_window_bytes += slen;
45
46 - qdisc_tree_reduce_backlog(sch, 1, len);
47 + qdisc_tree_reduce_backlog(sch, 1-numsegs, len-slen);
48 consume_skb(skb);
49 } else {
50 /* not splitting */