TencentOS-kernel/net/core
Alexander Lobakin c9ccb1022c gro: fix napi_gro_frags() Fast GRO breakage due to IP alignment check
[ Upstream commit 7ad18ff6449cbd6beb26b53128ddf56d2685aa93 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-20 16:07:59 +08:00
..
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
bpf_sk_storage.c bpf: Switch bpf_map ref counter to atomic64_t so bpf_map_inc() never fails 2021-03-16 16:43:58 +08:00
datagram.c udp: fix skb_copy_and_csum_datagram with odd segment sizes 2021-04-12 12:52:05 +08:00
datagram.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
dev.c gro: fix napi_gro_frags() Fast GRO breakage due to IP alignment check 2021-05-20 16:07:59 +08:00
dev_addr_lists.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
dev_ioctl.c net: fix dev_ifsioc_locked() race condition 2021-04-12 12:52:45 +08:00
devlink.c devlink: Hold rtnl lock while reading netdev attributes 2021-03-16 16:41:51 +08:00
drop_monitor.c drop_monitor: work around gcc-10 stringop-overflow warning 2021-03-16 16:27:46 +08:00
dst.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
dst_cache.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ethtool.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
failover.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
fib_notifier.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
fib_rules.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
filter.c bpf: Remove MTU check in __bpf_skb_max_len 2021-05-20 16:06:48 +08:00
flow_dissector.c flow_dissector: fix TTL and TOS dissection on IPv4 fragments 2021-05-20 16:06:47 +08:00
flow_offload.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
gen_estimator.c net_sched: gen_estimator: support large ewma log 2021-04-12 12:51:50 +08:00
gen_stats.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
gro_cells.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hwbm.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
link_watch.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
lwt_bpf.c lwt: Disable BH too in run_lwt_bpf() 2021-03-16 16:43:20 +08:00
lwtunnel.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
neighbour.c neighbour: Disregard DEAD dst in neigh_update 2021-05-20 16:07:08 +08:00
net-procfs.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
net-sysfs.c net-sysfs: take the rtnl lock when accessing xps_rxqs_map and num_tc 2021-04-12 12:51:08 +08:00
net-sysfs.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
net-traces.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
net_namespace.c merge bpf_get_netns_cookie from f318903c0bf42448b4c884732df2bbb0ef7a2284. 2021-03-16 16:43:59 +08:00
netclassid_cgroup.c cgroup, netclassid: remove double cond_resched 2021-03-16 16:27:30 +08:00
netevent.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
netpoll.c net: Have netpoll bring-up DSA management interface 2021-03-16 16:41:06 +08:00
netprio_cgroup.c netprio_cgroup: Fix unlimited memory leak of v2 cgroups 2021-03-16 16:27:49 +08:00
page_pool.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pktgen.c pktgen: fix misuse of BUG_ON() in pktgen_thread_worker() 2021-04-12 12:52:46 +08:00
ptp_classifier.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
request_sock.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
rtnetlink.c net: fix dev_ifsioc_locked() race condition 2021-04-12 12:52:45 +08:00
scm.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
secure_seq.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
skbuff.c net: fix up truesize of cloned skb in skb_prepare_for_shift() 2021-04-12 12:52:44 +08:00
skmsg.c bpf, sockmap: Avoid returning unneeded EAGAIN when redirecting to self 2021-03-16 16:41:24 +08:00
sock.c net: let skb_orphan_partial wake-up waiters. 2021-05-20 16:06:57 +08:00
sock_diag.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sock_map.c bpf: sockmap: Require attach_bpf_fd when detaching a program 2021-03-16 16:32:59 +08:00
sock_reuseport.c udp: Prevent reuseport_select_sock from reading uninitialized socks 2021-04-12 12:51:29 +08:00
stream.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sysctl_net_core.c bpf: Check correct cred for CAP_SYSLOG in bpf_dump_raw_ok() 2021-03-16 16:31:38 +08:00
timestamping.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
tso.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
utils.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
xdp.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00