From 3e47ecf0c3f8477244571bbd29195da18b03fe29 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Sat, 1 Apr 2023 08:32:30 +0200 Subject: [PATCH] Add GSO/GRO/TSO/LRO & UFO configuration for each network interface --- .../luci-static/resources/tools/network.js | 15 +++++++++++++++ mptcp/files/etc/init.d/mptcp | 17 +++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/luci-mod-network/htdocs/luci-static/resources/tools/network.js b/luci-mod-network/htdocs/luci-static/resources/tools/network.js index 311242905..6f16713fe 100644 --- a/luci-mod-network/htdocs/luci-static/resources/tools/network.js +++ b/luci-mod-network/htdocs/luci-static/resources/tools/network.js @@ -625,6 +625,21 @@ return baseclass.extend({ o = this.replaceOption(s, 'devadvanced', form.Flag, 'autoneg', _('Autonegociation')); o.default = o.enabled; + o = this.replaceOption(s, 'devadvanced', form.Flag, 'gro', _('Generic Receive Offload (GRO)')); + o.default = o.enabled; + + o = this.replaceOption(s, 'devadvanced', form.Flag, 'gso', _('Generic Segmentation Offload (GSO)')); + o.default = o.enabled; + + o = this.replaceOption(s, 'devadvanced', form.Flag, 'tso', _('TCP Segmentation Offload (TSO)')); + o.default = o.enabled; + + o = this.replaceOption(s, 'devadvanced', form.Flag, 'lro', _('Large Receive Offload (LRO)')); + o.default = o.enabled; + + o = this.replaceOption(s, 'devadvanced', form.Flag, 'ufo', _('UDP Fragmentation Offload (UFO)')); + o.default = o.enabled; + o = this.replaceOption(s, 'devadvanced', form.Value, 'speed', _('Speed')); o.placeholder = dev ? dev.getSpeed() : ''; o.default = ''; diff --git a/mptcp/files/etc/init.d/mptcp b/mptcp/files/etc/init.d/mptcp index 0e3a0b391..b444420f4 100755 --- a/mptcp/files/etc/init.d/mptcp +++ b/mptcp/files/etc/init.d/mptcp @@ -116,6 +116,23 @@ interface_multipath_settings() { uci -q set openmptcprouter.${config}.metric=$metric config_get mode "$config" multipath id=$metric + [ -n "$iface" ] && { + gro=$(uci -q network.${config}.gro) + [ "$gro" = "1" ] && ethtool -K $iface gro on 2>&1 >/dev/null + [ "$gro" = "0" ] && ethtool -K $iface gro on 2>&1 >/dev/null + gso=$(uci -q network.${config}.gso) + [ "$gso" = "1" ] && ethtool -K $iface gso on 2>&1 >/dev/null + [ "$gso" = "0" ] && ethtool -K $iface gso on 2>&1 >/dev/null + lro=$(uci -q network.${config}.lro) + [ "$lro" = "1" ] && ethtool -K $iface lro on 2>&1 >/dev/null + [ "$lro" = "0" ] && ethtool -K $iface lro on 2>&1 >/dev/null + ufo=$(uci -q network.${config}.ufo) + [ "$ufo" = "1" ] && ethtool -K $iface ufo on 2>&1 >/dev/null + [ "$ufo" = "0" ] && ethtool -K $iface ufo on 2>&1 >/dev/null + tso=$(uci -q network.${config}.tso) + [ "$tso" = "1" ] && ethtool -K $iface tso on 2>&1 >/dev/null + [ "$tso" = "0" ] && ethtool -K $iface tso on 2>&1 >/dev/null + } [ "$mode" = "" ] && { mode="$(uci -q get openmptcprouter.${config}.multipath)" [ -n "$mode" ] && uci -q set network.${config}.multipath="$mode"