diff --git a/package/mtk/applications/luci-app-eqos-mtk/root/usr/sbin/eqos b/package/mtk/applications/luci-app-eqos-mtk/root/usr/sbin/eqos index 835b67972c..872531a804 100755 --- a/package/mtk/applications/luci-app-eqos-mtk/root/usr/sbin/eqos +++ b/package/mtk/applications/luci-app-eqos-mtk/root/usr/sbin/eqos @@ -72,6 +72,8 @@ case "$1" in echo 0 0 0 0 0 0 0 > /sys/kernel/debug/hnat/qdma_txq0 echo 1 0 0 0 0 0 0 > /sys/kernel/debug/hnat/qdma_txq8 echo "11 5" >/sys/kernel/debug/hnat/hnat_setting + uci -q set "turboacc.config.fastpath_mh_eth_hnat_bind_rate"="5" + uci -q commit "turboacc" sed -i '/\/etc\/init.d\/eqos start/d' /etc/firewall.user echo "/etc/init.d/eqos start" >> /etc/firewall.user echo "10 1" > /sys/kernel/debug/hnat/hnat_setting diff --git a/package/mtk/applications/luci-app-turboacc-mtk/htdocs/luci-static/resources/view/turboacc.js b/package/mtk/applications/luci-app-turboacc-mtk/htdocs/luci-static/resources/view/turboacc.js index aa316d52ff..3c925ffaa1 100644 --- a/package/mtk/applications/luci-app-turboacc-mtk/htdocs/luci-static/resources/view/turboacc.js +++ b/package/mtk/applications/luci-app-turboacc-mtk/htdocs/luci-static/resources/view/turboacc.js @@ -173,6 +173,18 @@ return view.extend({ o.default = o.enabled; o.rmempty = false; o.depends('fastpath_mh_eth_hnat', '1'); + + o = s.option(form.Flag, 'fastpath_mh_eth_hnat_macvlan', _('Enable ethernet HNAT for MACVLAN'), + _('Enable hardware offloading for macvlan (sing wan only).')); + o.default = o.enabled; + o.rmempty = false; + o.depends('fastpath_mh_eth_hnat', '1'); + + o = s.option(form.Value, 'fastpath_mh_eth_hnat_bind_rate', _('HNAT bind rate threshold (pps/s)'), + _('The smaller the threshold, the easier it is for the connection to be accelerated.')); + o.datatype = 'and(uinteger,min(1))'; + o.rmempty = false; + o.depends('fastpath_mh_eth_hnat', '1'); o = s.option(form.ListValue, 'fullcone', _('Full cone NAT'), _('Full cone NAT (NAT1) can improve gaming performance effectively.')); diff --git a/package/mtk/applications/luci-app-turboacc-mtk/po/zh_Hans/turboacc.po b/package/mtk/applications/luci-app-turboacc-mtk/po/zh_Hans/turboacc.po index 5e5a7c5af5..af1770aaf2 100644 --- a/package/mtk/applications/luci-app-turboacc-mtk/po/zh_Hans/turboacc.po +++ b/package/mtk/applications/luci-app-turboacc-mtk/po/zh_Hans/turboacc.po @@ -57,6 +57,24 @@ msgstr "启用以太网 IPv6 HNAT" msgid "Enable hardware offloading for wired IPv6 connections." msgstr "为有线 IPv6 连接启用硬件加速。" +#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:177 +msgid "Enable ethernet HNAT for MACVLAN" +msgstr "启用MACVLAN HNAT" + +#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:178 +msgid "Enable hardware offloading for macvlan (sing wan only)." +msgstr "为MACVLAN 连接启用硬件加速(仅支持单WAN)。" + +#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:183 +msgid "HNAT bind rate threshold (pps/s)" +msgstr "HNAT加速速率阈值(pps/s)" + +#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:184 +msgid "The smaller the threshold, the easier it is for the connection to be accelerated." +msgstr "阈值越小,连接越容易被加速。" + + + #: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:166 msgid "Enable hardware offloading for wired connections." msgstr "为有线连接启用硬件加速。" diff --git a/package/mtk/applications/luci-app-turboacc-mtk/root/etc/init.d/turboacc b/package/mtk/applications/luci-app-turboacc-mtk/root/etc/init.d/turboacc index 29fef4e9ef..83154795de 100755 --- a/package/mtk/applications/luci-app-turboacc-mtk/root/etc/init.d/turboacc +++ b/package/mtk/applications/luci-app-turboacc-mtk/root/etc/init.d/turboacc @@ -43,7 +43,7 @@ start() { lsmod |grep -q "shortcut_fe_cm" || modprobe "shortcut_fe_cm" 2>"/dev/null" ;; "mediatek_hnat") - local fastpath_mh_eth_hnat fastpath_mh_eth_hnat_v6 + local fastpath_mh_eth_hnat fastpath_mh_eth_hnat_v6 fastpath_mh_eth_hnat_macvlan config_get_bool fastpath_mh_eth_hnat "config" "fastpath_mh_eth_hnat" "1" local hnat_path="/sys/kernel/debug/hnat" echo "$fastpath_mh_eth_hnat" > "$hnat_path/hook_toggle" @@ -51,6 +51,14 @@ start() { config_get_bool fastpath_mh_eth_hnat_v6 "config" "fastpath_mh_eth_hnat_v6" "1" echo "8 $fastpath_mh_eth_hnat_v6" > "$hnat_path/hnat_setting" fi + if [ "$fastpath_mh_eth_hnat" -eq "1" ]; then + config_get_bool fastpath_mh_eth_hnat_macvlan "config" "fastpath_mh_eth_hnat_macvlan" "1" + echo "12 $fastpath_mh_eth_hnat_macvlan" > "$hnat_path/hnat_setting" + fi + if [ "$fastpath_mh_eth_hnat" -eq "1" ]; then + config_get_bool fastpath_mh_eth_hnat_macvlan "config" "fastpath_mh_eth_hnat_bind_rate" "1" + echo "11 $fastpath_mh_eth_hnat_bind_rate" > "$hnat_path/hnat_setting" + fi ;; esac diff --git a/package/mtk/applications/luci-app-turboacc-mtk/root/etc/uci-defaults/turboacc b/package/mtk/applications/luci-app-turboacc-mtk/root/etc/uci-defaults/turboacc index 392b4a6790..caf8e9753a 100644 --- a/package/mtk/applications/luci-app-turboacc-mtk/root/etc/uci-defaults/turboacc +++ b/package/mtk/applications/luci-app-turboacc-mtk/root/etc/uci-defaults/turboacc @@ -18,6 +18,8 @@ if [ -e "/lib/modules/$kernel_ver/mtkhnat.ko" ]; then uci -q set "turboacc.config.fastpath"="mediatek_hnat" uci -q set "turboacc.config.fastpath_mh_eth_hnat"="1" uci -q set "turboacc.config.fastpath_mh_eth_hnat_v6"="1" + uci -q set "turboacc.config.fastpath_mh_eth_hnat_macvlan"="0" + uci -q set "turboacc.config.fastpath_mh_eth_hnat_bind_rate"="30" elif [ -e "/lib/modules/$kernel_ver/fast-classifier.ko" ]; then uci -q set "turboacc.config.fastpath"="fast_classifier" uci -q set "turboacc.config.fastpath_fc_br"="1"