mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-07 01:53:34 +08:00
luci-app-turboacc-mtk: add ppe_num setting
This commit is contained in:
parent
e0fa787d3e
commit
be2b71c18c
@ -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'))
|
||||
|
@ -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数量"
|
||||
|
@ -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"
|
||||
|
@ -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
|
Loading…
x
Reference in New Issue
Block a user