bcm53xx: copy patch disabling GRO to kernel 5.15
[openwrt/openwrt.git] / target / linux / bcm53xx / patches-5.15 / 600-net-disable-GRO-by-default.patch
1 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
2 Date: Mon, 20 Jun 2022 10:01:18 +0200
3 Subject: [PATCH] net: disable GRO by default
4 MIME-Version: 1.0
5 Content-Type: text/plain; charset=UTF-8
6 Content-Transfer-Encoding: 8bit
7
8 In many cases GRO improves network performance however it comes at a
9 cost of chacksums calculations. In case of slow CPU and missing hardware
10 csum calculation support GRO can actually decrease network speed.
11
12 On BCM4708 *disabling* GRO results in following NAT masquarade speed
13 changes:
14 1. 364 Mb/s → 396 Mb/s (packet steering disabled)
15 2. 341 Mb/s → 566 Mb/s (packet steering enabled)
16
17 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
18 ---
19 include/linux/netdev_features.h | 4 ++--
20 1 file changed, 2 insertions(+), 2 deletions(-)
21
22 --- a/include/linux/netdev_features.h
23 +++ b/include/linux/netdev_features.h
24 @@ -242,10 +242,10 @@ static inline int find_next_netdev_featu
25 #define NETIF_F_UPPER_DISABLES NETIF_F_LRO
26
27 /* changeable features with no special hardware requirements */
28 -#define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO)
29 +#define NETIF_F_SOFT_FEATURES (NETIF_F_GSO)
30
31 /* Changeable features with no special hardware requirements that defaults to off. */
32 -#define NETIF_F_SOFT_FEATURES_OFF (NETIF_F_GRO_FRAGLIST | NETIF_F_GRO_UDP_FWD)
33 +#define NETIF_F_SOFT_FEATURES_OFF (NETIF_F_GRO_FRAGLIST | NETIF_F_GRO_UDP_FWD | NETIF_F_GRO)
34
35 #define NETIF_F_VLAN_FEATURES (NETIF_F_HW_VLAN_CTAG_FILTER | \
36 NETIF_F_HW_VLAN_CTAG_RX | \