kernel: Update kernel 5.4 to version 5.4.50
Run tested: ath79, ipq40xx Build tested: ath79, ipq40xx Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>master
parent
6062d85892
commit
68d9cb8214
@ -1,96 +0,0 @@
|
||||
From 9208d2863ac689a563b92f2161d8d1e7127d0add Mon Sep 17 00:00:00 2001
|
||||
From: Ilya Ponetayev <i.ponetaev@ndmsystems.com>
|
||||
Date: Thu, 25 Jun 2020 22:12:07 +0200
|
||||
Subject: [PATCH] sch_cake: don't try to reallocate or unshare skb
|
||||
unconditionally
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
cake_handle_diffserv() tries to linearize mac and network header parts of
|
||||
skb and to make it writable unconditionally. In some cases it leads to full
|
||||
skb reallocation, which reduces throughput and increases CPU load. Some
|
||||
measurements of IPv4 forward + NAPT on MIPS router with 580 MHz single-core
|
||||
CPU was conducted. It appears that on kernel 4.9 skb_try_make_writable()
|
||||
reallocates skb, if skb was allocated in ethernet driver via so-called
|
||||
'build skb' method from page cache (it was discovered by strange increase
|
||||
of kmalloc-2048 slab at first).
|
||||
|
||||
Obtain DSCP value via read-only skb_header_pointer() call, and leave
|
||||
linearization only for DSCP bleaching or ECN CE setting. And, as an
|
||||
additional optimisation, skip diffserv parsing entirely if it is not needed
|
||||
by the current configuration.
|
||||
|
||||
Fixes: c87b4ecdbe8d ("sch_cake: Make sure we can write the IP header before changing DSCP bits")
|
||||
Signed-off-by: Ilya Ponetayev <i.ponetaev@ndmsystems.com>
|
||||
[ fix a few style issues, reflow commit message ]
|
||||
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 | 41 ++++++++++++++++++++++++++++++-----------
|
||||
1 file changed, 30 insertions(+), 11 deletions(-)
|
||||
|
||||
--- a/net/sched/sch_cake.c
|
||||
+++ b/net/sched/sch_cake.c
|
||||
@@ -1553,30 +1553,49 @@ static unsigned int cake_drop(struct Qdi
|
||||
|
||||
static u8 cake_handle_diffserv(struct sk_buff *skb, u16 wash)
|
||||
{
|
||||
- int wlen = skb_network_offset(skb);
|
||||
+ const int offset = skb_network_offset(skb);
|
||||
+ u16 *buf, buf_;
|
||||
u8 dscp;
|
||||
|
||||
switch (tc_skb_protocol(skb)) {
|
||||
case htons(ETH_P_IP):
|
||||
- wlen += sizeof(struct iphdr);
|
||||
- if (!pskb_may_pull(skb, wlen) ||
|
||||
- skb_try_make_writable(skb, wlen))
|
||||
+ buf = skb_header_pointer(skb, offset, sizeof(buf_), &buf_);
|
||||
+ if (unlikely(!buf))
|
||||
return 0;
|
||||
|
||||
- dscp = ipv4_get_dsfield(ip_hdr(skb)) >> 2;
|
||||
- if (wash && dscp)
|
||||
+ /* ToS is in the second byte of iphdr */
|
||||
+ dscp = ipv4_get_dsfield((struct iphdr *)buf) >> 2;
|
||||
+
|
||||
+ if (wash && dscp) {
|
||||
+ const int wlen = offset + sizeof(struct iphdr);
|
||||
+
|
||||
+ if (!pskb_may_pull(skb, wlen) ||
|
||||
+ skb_try_make_writable(skb, wlen))
|
||||
+ return 0;
|
||||
+
|
||||
ipv4_change_dsfield(ip_hdr(skb), INET_ECN_MASK, 0);
|
||||
+ }
|
||||
+
|
||||
return dscp;
|
||||
|
||||
case htons(ETH_P_IPV6):
|
||||
- wlen += sizeof(struct ipv6hdr);
|
||||
- if (!pskb_may_pull(skb, wlen) ||
|
||||
- skb_try_make_writable(skb, wlen))
|
||||
+ buf = skb_header_pointer(skb, offset, sizeof(buf_), &buf_);
|
||||
+ if (unlikely(!buf))
|
||||
return 0;
|
||||
|
||||
- dscp = ipv6_get_dsfield(ipv6_hdr(skb)) >> 2;
|
||||
- if (wash && dscp)
|
||||
+ /* Traffic class is in the first and second bytes of ipv6hdr */
|
||||
+ dscp = ipv6_get_dsfield((struct ipv6hdr *)buf) >> 2;
|
||||
+
|
||||
+ if (wash && dscp) {
|
||||
+ const int wlen = offset + sizeof(struct ipv6hdr);
|
||||
+
|
||||
+ if (!pskb_may_pull(skb, wlen) ||
|
||||
+ skb_try_make_writable(skb, wlen))
|
||||
+ return 0;
|
||||
+
|
||||
ipv6_change_dsfield(ipv6_hdr(skb), INET_ECN_MASK, 0);
|
||||
+ }
|
||||
+
|
||||
return dscp;
|
||||
|
||||
case htons(ETH_P_ARP):
|
@ -1,62 +0,0 @@
|
||||
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))
|
@ -1,40 +0,0 @@
|
||||
From 3f608f0c41360b11b04c763f348b712f651c8bac 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:09 +0200
|
||||
Subject: [PATCH] sch_cake: fix a few style nits
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
I spotted a few nits when comparing the in-tree version of sch_cake with
|
||||
the out-of-tree one: A redundant error variable declaration shadowing an
|
||||
outer declaration, and an indentation alignment issue. Fix both of these.
|
||||
|
||||
Fixes: 046f6fd5daef ("sched: Add Common Applications Kept Enhanced (cake) qdisc")
|
||||
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 | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/net/sched/sch_cake.c
|
||||
+++ b/net/sched/sch_cake.c
|
||||
@@ -2717,7 +2717,7 @@ static int cake_init(struct Qdisc *sch,
|
||||
qdisc_watchdog_init(&q->watchdog, sch);
|
||||
|
||||
if (opt) {
|
||||
- int err = cake_change(sch, opt, extack);
|
||||
+ err = cake_change(sch, opt, extack);
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
@@ -3034,7 +3034,7 @@ static int cake_dump_class_stats(struct
|
||||
PUT_STAT_S32(BLUE_TIMER_US,
|
||||
ktime_to_us(
|
||||
ktime_sub(now,
|
||||
- flow->cvars.blue_timer)));
|
||||
+ flow->cvars.blue_timer)));
|
||||
}
|
||||
if (flow->cvars.dropping) {
|
||||
PUT_STAT_S32(DROP_NEXT_US,
|
@ -1,47 +0,0 @@
|
||||
From: Russell King <rmk+kernel@armlinux.org.uk>
|
||||
Bcc: linux@mail.armlinux.org.uk
|
||||
Cc: linux-i2c@vger.kernel.org
|
||||
Subject: [PATCH 10/17] i2c: pxa: fix i2c_pxa_scream_blue_murder() debug output
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
|
||||
The IRQ log output is supposed to appear on a single line. However,
|
||||
commit 3a2dc1677b60 ("i2c: pxa: Update debug function to dump more info
|
||||
on error") resulted in it being printed one-entry-per-line, which is
|
||||
excessively long.
|
||||
|
||||
Fixing this is not a trivial matter; using pr_cont() doesn't work as
|
||||
the previous dev_dbg() may not have been compiled in, or may be
|
||||
dynamic.
|
||||
|
||||
Since the rest of this function output is at error level, and is also
|
||||
debug output, promote this to error level as well to avoid this
|
||||
problem.
|
||||
|
||||
Reduce the number of always zero prefix digits to save screen real-
|
||||
estate.
|
||||
|
||||
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
|
||||
---
|
||||
drivers/i2c/busses/i2c-pxa.c | 7 +++----
|
||||
1 file changed, 3 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/i2c/busses/i2c-pxa.c
|
||||
+++ b/drivers/i2c/busses/i2c-pxa.c
|
||||
@@ -364,11 +364,10 @@ static void i2c_pxa_scream_blue_murder(s
|
||||
dev_err(dev, "IBMR: %08x IDBR: %08x ICR: %08x ISR: %08x\n",
|
||||
readl(_IBMR(i2c)), readl(_IDBR(i2c)), readl(_ICR(i2c)),
|
||||
readl(_ISR(i2c)));
|
||||
- dev_dbg(dev, "log: ");
|
||||
+ dev_err(dev, "log:");
|
||||
for (i = 0; i < i2c->irqlogidx; i++)
|
||||
- pr_debug("[%08x:%08x] ", i2c->isrlog[i], i2c->icrlog[i]);
|
||||
-
|
||||
- pr_debug("\n");
|
||||
+ pr_cont(" [%03x:%05x]", i2c->isrlog[i], i2c->icrlog[i]);
|
||||
+ pr_cont("\n");
|
||||
}
|
||||
|
||||
#else /* ifdef DEBUG */
|
@ -1,38 +0,0 @@
|
||||
From: Russell King <rmk+kernel@armlinux.org.uk>
|
||||
Bcc: linux@mail.armlinux.org.uk
|
||||
Subject: [PATCH 5/7] i2c: pxa: clear all master action bits in
|
||||
i2c_pxa_stop_message()
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
|
||||
If we timeout during a message transfer, the control register may
|
||||
contain bits that cause an action to be set. Read-modify-writing the
|
||||
register leaving these bits set may trigger the hardware to attempt
|
||||
one of these actions unintentionally.
|
||||
|
||||
Always clear these bits when cleaning up after a message or after
|
||||
a timeout.
|
||||
|
||||
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
|
||||
---
|
||||
drivers/i2c/busses/i2c-pxa.c | 6 ++----
|
||||
1 file changed, 2 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/i2c/busses/i2c-pxa.c
|
||||
+++ b/drivers/i2c/busses/i2c-pxa.c
|
||||
@@ -754,11 +754,9 @@ static inline void i2c_pxa_stop_message(
|
||||
{
|
||||
u32 icr;
|
||||
|
||||
- /*
|
||||
- * Clear the STOP and ACK flags
|
||||
- */
|
||||
+ /* Clear the START, STOP, ACK, TB and MA flags */
|
||||
icr = readl(_ICR(i2c));
|
||||
- icr &= ~(ICR_STOP | ICR_ACKNAK);
|
||||
+ icr &= ~(ICR_START | ICR_STOP | ICR_ACKNAK | ICR_TB | ICR_MA);
|
||||
writel(icr, _ICR(i2c));
|
||||
}
|
||||
|
Loading…
Reference in New Issue