1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-14 11:31:51 +00:00

Add GSO/GRO/TSO/LRO & UFO configuration for each network interface

This commit is contained in:
Ycarus (Yannick Chabanois) 2023-04-01 08:32:30 +02:00
parent be8b7165fc
commit 3e47ecf0c3
2 changed files with 32 additions and 0 deletions

View file

@ -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 = '';

View file

@ -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"