aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/backport-5.4/397-5.8-sch_cake-don-t-call-diffserv-parsing-code-when-it-is.patch
diff options
context:
space:
mode:
authorKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>2020-01-18 15:35:38 +0000
committerKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>2020-06-30 16:09:18 +0100
commitd59dc14515c812ba4c4101958bdc5dba37ab34cb (patch)
treea6170b6f3a687bcb7e79236f4b08f4b8d0448b89 /target/linux/generic/backport-5.4/397-5.8-sch_cake-don-t-call-diffserv-parsing-code-when-it-is.patch
parent77cd8f64ca261bfb3cf5a905fb2f227981934613 (diff)
downloadupstream-d59dc14515c812ba4c4101958bdc5dba37ab34cb.tar.gz
upstream-d59dc14515c812ba4c4101958bdc5dba37ab34cb.tar.bz2
upstream-d59dc14515c812ba4c4101958bdc5dba37ab34cb.zip
kernel: cake: backport upstream tweaks & fixes
From upstream: b8392808eb3f sch_cake: add RFC 8622 LE PHB support to CAKE diffserv handling 3f608f0c4136 sch_cake: fix a few style nits 8c95eca0bb8c sch_cake: don't call diffserv parsing code when it is not needed 9208d2863ac6 sch_cake: don't try to reallocate or unshare skb unconditionally From netdev not yet accepted: sch_cake: fix IP protocol handling in the presence of VLAN tags The VLAN tag handling is actually wider than just cake so upstream are working out how to fix it generically. We fix it here just for cake. Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Diffstat (limited to 'target/linux/generic/backport-5.4/397-5.8-sch_cake-don-t-call-diffserv-parsing-code-when-it-is.patch')
-rw-r--r--target/linux/generic/backport-5.4/397-5.8-sch_cake-don-t-call-diffserv-parsing-code-when-it-is.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/target/linux/generic/backport-5.4/397-5.8-sch_cake-don-t-call-diffserv-parsing-code-when-it-is.patch b/target/linux/generic/backport-5.4/397-5.8-sch_cake-don-t-call-diffserv-parsing-code-when-it-is.patch
new file mode 100644
index 0000000000..2d9cd29780
--- /dev/null
+++ b/target/linux/generic/backport-5.4/397-5.8-sch_cake-don-t-call-diffserv-parsing-code-when-it-is.patch
@@ -0,0 +1,62 @@
+From 8c95eca0bb8c4bd2231a0d581f1ad0d50c90488c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= <toke@redhat.com>
+Date: Thu, 25 Jun 2020 22:12:08 +0200
+Subject: [PATCH] sch_cake: don't call diffserv parsing code when it is not
+ needed
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+As a further optimisation of the diffserv parsing codepath, we can skip it
+entirely if CAKE is configured to neither use diffserv-based
+classification, nor to zero out the diffserv bits.
+
+Fixes: c87b4ecdbe8d ("sch_cake: Make sure we can write the IP header before changing DSCP bits")
+Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
+---
+ net/sched/sch_cake.c | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+--- a/net/sched/sch_cake.c
++++ b/net/sched/sch_cake.c
+@@ -1551,7 +1551,7 @@ static unsigned int cake_drop(struct Qdi
+ return idx + (tin << 16);
+ }
+
+-static u8 cake_handle_diffserv(struct sk_buff *skb, u16 wash)
++static u8 cake_handle_diffserv(struct sk_buff *skb, bool wash)
+ {
+ const int offset = skb_network_offset(skb);
+ u16 *buf, buf_;
+@@ -1612,14 +1612,17 @@ static struct cake_tin_data *cake_select
+ {
+ struct cake_sched_data *q = qdisc_priv(sch);
+ u32 tin, mark;
++ bool wash;
+ u8 dscp;
+
+ /* Tin selection: Default to diffserv-based selection, allow overriding
+- * using firewall marks or skb->priority.
++ * using firewall marks or skb->priority. Call DSCP parsing early if
++ * wash is enabled, otherwise defer to below to skip unneeded parsing.
+ */
+- dscp = cake_handle_diffserv(skb,
+- q->rate_flags & CAKE_FLAG_WASH);
+ mark = (skb->mark & q->fwmark_mask) >> q->fwmark_shft;
++ wash = !!(q->rate_flags & CAKE_FLAG_WASH);
++ if (wash)
++ dscp = cake_handle_diffserv(skb, wash);
+
+ if (q->tin_mode == CAKE_DIFFSERV_BESTEFFORT)
+ tin = 0;
+@@ -1633,6 +1636,8 @@ static struct cake_tin_data *cake_select
+ tin = q->tin_order[TC_H_MIN(skb->priority) - 1];
+
+ else {
++ if (!wash)
++ dscp = cake_handle_diffserv(skb, wash);
+ tin = q->tin_index[dscp];
+
+ if (unlikely(tin >= q->tin_cnt))