kernel: bump 5.4 to 5.4.114
Manually rebased* generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch Added new backport* generic/backport-5.4/050-gro-fix-napi_gro_frags-Fast-GRO-breakage-due-to-IP-a.patch All others updated automatically. The new backport was included based on this[1] upstream commit that will be mainlined soon. This change is needed because Eric Dumazet's check for NET_IP_ALIGN (landed in 5.4.114) causes huge slowdowns on drivers which use napi_gro_frags(). Build system: x86_64 Build-tested: ipq806x/R7800 Run-tested: ipq806x/R7800 No dmesg regressions, everything functional *Credit to Alexander Lobakin 1. https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=7ad18ff6449cbd6beb26b53128ddf56d2685aa93 Signed-off-by: John Audia <graysky@archlinux.us>
This commit is contained in:
committed by
Hauke Mehrtens
parent
14a95b36b1
commit
0d2873df15
@@ -0,0 +1,75 @@
|
||||
From 3007b05df4301aad179acc6ca1c3645785576df6 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Lobakin <alobakin@pm.me>
|
||||
Date: Mon, 19 Apr 2021 12:53:06 +0000
|
||||
Subject: gro: fix napi_gro_frags() Fast GRO breakage due to IP
|
||||
alignment check
|
||||
|
||||
Commit 7ad18ff6449cbd6beb26b53128ddf56d2685aa93 upstream.
|
||||
|
||||
Commit 38ec4944b593 ("gro: ensure frag0 meets IP header alignment")
|
||||
did the right thing, but missed the fact that napi_gro_frags() logics
|
||||
calls for skb_gro_reset_offset() *before* pulling Ethernet header
|
||||
to the skb linear space.
|
||||
That said, the introduced check for frag0 address being aligned to 4
|
||||
always fails for it as Ethernet header is obviously 14 bytes long,
|
||||
and in case with NET_IP_ALIGN its start is not aligned to 4.
|
||||
|
||||
Fix this by adding @nhoff argument to skb_gro_reset_offset() which
|
||||
tells if an IP header is placed right at the start of frag0 or not.
|
||||
This restores Fast GRO for napi_gro_frags() that became very slow
|
||||
after the mentioned commit, and preserves the introduced check to
|
||||
avoid silent unaligned accesses.
|
||||
|
||||
From v1 [0]:
|
||||
- inline tiny skb_gro_reset_offset() to let the code be optimized
|
||||
more efficively (esp. for the !NET_IP_ALIGN case) (Eric);
|
||||
- pull in Reviewed-by from Eric.
|
||||
|
||||
[0] https://lore.kernel.org/netdev/20210418114200.5839-1-alobakin@pm.me
|
||||
|
||||
Fixes: 38ec4944b593 ("gro: ensure frag0 meets IP header alignment")
|
||||
Reviewed-by: Eric Dumazet <edumazet@google.com>
|
||||
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
net/core/dev.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/net/core/dev.c
|
||||
+++ b/net/core/dev.c
|
||||
@@ -5395,7 +5395,7 @@ static struct list_head *gro_list_prepar
|
||||
return head;
|
||||
}
|
||||
|
||||
-static void skb_gro_reset_offset(struct sk_buff *skb)
|
||||
+static inline void skb_gro_reset_offset(struct sk_buff *skb, u32 nhoff)
|
||||
{
|
||||
const struct skb_shared_info *pinfo = skb_shinfo(skb);
|
||||
const skb_frag_t *frag0 = &pinfo->frags[0];
|
||||
@@ -5407,7 +5407,7 @@ static void skb_gro_reset_offset(struct
|
||||
if (skb_mac_header(skb) == skb_tail_pointer(skb) &&
|
||||
pinfo->nr_frags &&
|
||||
!PageHighMem(skb_frag_page(frag0)) &&
|
||||
- (!NET_IP_ALIGN || !(skb_frag_off(frag0) & 3))) {
|
||||
+ (!NET_IP_ALIGN || !((skb_frag_off(frag0) + nhoff) & 3))) {
|
||||
NAPI_GRO_CB(skb)->frag0 = skb_frag_address(frag0);
|
||||
NAPI_GRO_CB(skb)->frag0_len = min_t(unsigned int,
|
||||
skb_frag_size(frag0),
|
||||
@@ -5640,7 +5640,7 @@ gro_result_t napi_gro_receive(struct nap
|
||||
skb_mark_napi_id(skb, napi);
|
||||
trace_napi_gro_receive_entry(skb);
|
||||
|
||||
- skb_gro_reset_offset(skb);
|
||||
+ skb_gro_reset_offset(skb, 0);
|
||||
|
||||
ret = napi_skb_finish(napi, skb, dev_gro_receive(napi, skb));
|
||||
trace_napi_gro_receive_exit(ret);
|
||||
@@ -5733,7 +5733,7 @@ static struct sk_buff *napi_frags_skb(st
|
||||
napi->skb = NULL;
|
||||
|
||||
skb_reset_mac_header(skb);
|
||||
- skb_gro_reset_offset(skb);
|
||||
+ skb_gro_reset_offset(skb, hlen);
|
||||
|
||||
if (unlikely(skb_gro_header_hard(skb, hlen))) {
|
||||
eth = skb_gro_header_slow(skb, hlen, 0);
|
||||
@@ -66,13 +66,13 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/net/core/dev.c
|
||||
+++ b/net/core/dev.c
|
||||
@@ -5404,8 +5404,7 @@ static void skb_gro_reset_offset(struct
|
||||
@@ -5404,8 +5404,7 @@ static inline void skb_gro_reset_offset(
|
||||
NAPI_GRO_CB(skb)->frag0 = NULL;
|
||||
NAPI_GRO_CB(skb)->frag0_len = 0;
|
||||
|
||||
- if (skb_mac_header(skb) == skb_tail_pointer(skb) &&
|
||||
- pinfo->nr_frags &&
|
||||
+ if (!skb_headlen(skb) && pinfo->nr_frags &&
|
||||
!PageHighMem(skb_frag_page(frag0))) {
|
||||
!PageHighMem(skb_frag_page(frag0)) &&
|
||||
(!NET_IP_ALIGN || !((skb_frag_off(frag0) + nhoff) & 3))) {
|
||||
NAPI_GRO_CB(skb)->frag0 = skb_frag_address(frag0);
|
||||
NAPI_GRO_CB(skb)->frag0_len = min_t(unsigned int,
|
||||
|
||||
@@ -25,7 +25,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -4926,6 +4926,80 @@ static int mv88e6xxx_port_mdb_del(struct
|
||||
@@ -4922,6 +4922,80 @@ static int mv88e6xxx_port_mdb_del(struct
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
static int mv88e6xxx_port_egress_floods(struct dsa_switch *ds, int port,
|
||||
bool unicast, bool multicast)
|
||||
{
|
||||
@@ -4980,6 +5054,8 @@ static const struct dsa_switch_ops mv88e
|
||||
@@ -4976,6 +5050,8 @@ static const struct dsa_switch_ops mv88e
|
||||
.port_mdb_prepare = mv88e6xxx_port_mdb_prepare,
|
||||
.port_mdb_add = mv88e6xxx_port_mdb_add,
|
||||
.port_mdb_del = mv88e6xxx_port_mdb_del,
|
||||
|
||||
@@ -19,7 +19,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -4993,7 +4993,7 @@ static void mv88e6xxx_port_mirror_del(st
|
||||
@@ -4989,7 +4989,7 @@ static void mv88e6xxx_port_mirror_del(st
|
||||
if (chip->info->ops->set_egress_port(chip,
|
||||
direction,
|
||||
dsa_upstream_port(ds,
|
||||
|
||||
Reference in New Issue
Block a user