Skip to content

Commit

Permalink
mediatek: hnat: set default ppe num to 2
Browse files Browse the repository at this point in the history
  • Loading branch information
hanwckf committed Jan 19, 2024
1 parent f518559 commit 31c2a04
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ 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
uci -q set "turboacc.config.fastpath_mh_eth_hnat_ppenum"="2"
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"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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
echo "mtkhnat ppe_cnt=${PPE_NUM:-2}" > /etc/modules.d/20-mediatek_hnat
fi
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ EXPORT_SYMBOL(ppe_dev_register_hook);
void (*ppe_dev_unregister_hook)(struct net_device *dev) = NULL;
EXPORT_SYMBOL(ppe_dev_unregister_hook);

static int ppe_cnt = 1;
static int ppe_cnt = 2;
module_param(ppe_cnt, int, 0);

static void hnat_sma_build_entry(struct timer_list *t)
Expand Down
2 changes: 1 addition & 1 deletion target/linux/mediatek/modules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ define KernelPackage/mediatek_hnat
TITLE:=Mediatek HNAT module
DEPENDS:=@TARGET_mediatek +kmod-nf-conntrack
AUTOLOAD:=$(call AutoLoad,20,mtkhnat)
MODPARAMS.mtkhnat:=ppe_cnt=1
MODPARAMS.mtkhnat:=ppe_cnt=2
KCONFIG:= \
CONFIG_BRIDGE_NETFILTER=y \
CONFIG_NETFILTER_FAMILY_BRIDGE=y \
Expand Down

0 comments on commit 31c2a04

Please sign in to comment.