[PATCH] bcm53xx: disable GRO support at kernel level

Rafał Miłecki zajec5 at gmail.com
Fri Jun 10 06:16:45 PDT 2022


From: Rafał Miłecki <rafal at milecki.pl>

This improves NAT masquarade network performance.

An alternative to kernel change would be runtime setup but that requires
ethtool and identifying relevant network interface and all related
switch ports interfaces.

Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
---
 .../600-net-disable-GRO-support.patch         | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 target/linux/bcm53xx/patches-5.10/600-net-disable-GRO-support.patch

diff --git a/target/linux/bcm53xx/patches-5.10/600-net-disable-GRO-support.patch b/target/linux/bcm53xx/patches-5.10/600-net-disable-GRO-support.patch
new file mode 100644
index 0000000000..1024aec7e1
--- /dev/null
+++ b/target/linux/bcm53xx/patches-5.10/600-net-disable-GRO-support.patch
@@ -0,0 +1,46 @@
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Fri, 10 Jun 2022 15:08:33 +0200
+Subject: [PATCH] net: disable GRO support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+In many cases GRO improves network performance however it comes at a
+cost of chacksums calculations. In case of slow CPU and missing hardware
+csum calculation support GRO can actually decrease network speed.
+
+On BCM4708 *disabling* GRO results in following NAT masquarade speed
+changes:
+1. 364 Mb/s → 396 Mb/s (packet steering disabled)
+2. 341 Mb/s → 566 Mb/s (packet steering enabled)
+
+Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
+---
+ net/8021q/vlan_core.c | 2 ++
+ net/ipv4/af_inet.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+--- a/net/8021q/vlan_core.c
++++ b/net/8021q/vlan_core.c
+@@ -544,6 +544,8 @@ static int __init vlan_offload_init(void)
+ {
+ 	unsigned int i;
+ 
++	return -ENOTSUPP;
++
+ 	for (i = 0; i < ARRAY_SIZE(vlan_packet_offloads); i++)
+ 		dev_add_offload(&vlan_packet_offloads[i]);
+ 
+diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
+index 8267349..6194a14 100644
+--- a/net/ipv4/af_inet.c
++++ b/net/ipv4/af_inet.c
+@@ -1913,6 +1913,8 @@ static int __init ipip_offload_init(void)
+ 
+ static int __init ipv4_offload_init(void)
+ {
++	return -ENOTSUPP;
++
+ 	/*
+ 	 * Add offloads
+ 	 */
-- 
2.34.1




More information about the openwrt-devel mailing list