]> git.dujemihanovic.xyz Git - linux.git/commit
net: add heuristic for enabling TCP fraglist GRO
authorFelix Fietkau <nbd@nbd.name>
Thu, 2 May 2024 08:44:47 +0000 (10:44 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Mon, 6 May 2024 09:54:04 +0000 (11:54 +0200)
commitc9d1d23e5239f41700be69133a5769ac5ebc88a8
tree439869d1784f0ed65704c3aa34f173f016c197d6
parent7516b27c555c1711ec17a5d891befb6986e573a3
net: add heuristic for enabling TCP fraglist GRO

When forwarding TCP after GRO, software segmentation is very expensive,
especially when the checksum needs to be recalculated.
One case where that's currently unavoidable is when routing packets over
PPPoE. Performance improves significantly when using fraglist GRO
implemented in the same way as for UDP.

When NETIF_F_GRO_FRAGLIST is enabled, perform a lookup for an established
socket in the same netns as the receiving device. While this may not
cover all relevant use cases in multi-netns configurations, it should be
good enough for most configurations that need this.

Here's a measurement of running 2 TCP streams through a MediaTek MT7622
device (2-core Cortex-A53), which runs NAT with flow offload enabled from
one ethernet port to PPPoE on another ethernet port + cake qdisc set to
1Gbps.

rx-gro-list off: 630 Mbit/s, CPU 35% idle
rx-gro-list on:  770 Mbit/s, CPU 40% idle

Acked-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Reviewed-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/ipv4/tcp_offload.c
net/ipv6/tcpv6_offload.c