luci-app-turboacc-mtk: add ppe_num setting

This commit is contained in:
hanwckf 2023-12-31 11:17:37 +08:00
parent e0fa787d3e
commit be2b71c18c
4 changed files with 25 additions and 0 deletions

View File

@ -187,6 +187,14 @@ return view.extend({
o.placeholder = 30;
o.depends('fastpath_mh_eth_hnat', '1');
o = s.option(form.ListValue, 'fastpath_mh_eth_hnat_ppenum', _('Number of HNAT PPE'),
_('Apply this setting after reboot.'));
o.rmempty = false;
o.value(1);
o.value(2);
o.default = 1;
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.'));
o.value('0', _('Disable'))

View File

@ -189,3 +189,8 @@ msgstr "网络加速设置"
msgid "XT_FULLCONE_NAT"
msgstr "XT_FULLCONE_NAT(更佳的兼容性)"
msgid "Apply this setting after reboot."
msgstr "重启后应用此项设置。"
msgid "Number of HNAT PPE"
msgstr "HNAT PPE数量"

View File

@ -20,6 +20,10 @@ if [ -e "/lib/modules/$kernel_ver/mtkhnat.ko" ]; then
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"
local mem="$(awk '/^MemTotal:/ {print $2}' /proc/meminfo)"
if [ "$mem" -gt 262144 ]; then
uci -q set "turboacc.config.fastpath_mh_eth_hnat_ppenum"="2"
fi
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"

View File

@ -0,0 +1,8 @@
do_setup_ppenum() {
if [ -f "/etc/modules.d/20-mediatek_hnat" ]; then
PPE_NUM="$(uci -q get turboacc.config.fastpath_mh_eth_hnat_ppenum)"
echo "mtkhnat ppe_cnt=${PPE_NUM:-1}" > /etc/modules.d/20-mediatek_hnat
fi
}
boot_hook_add preinit_main do_setup_ppenum