mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-07 01:53:34 +08:00
Mediatek:adjust bind rate when using hqos
This commit is contained in:
parent
c6da3115e6
commit
1c7a824799
@ -37,12 +37,17 @@ case "$1" in
|
||||
ip6tables -t mangle -D FORWARD -i br-lan -j DSCP --set-dscp 0
|
||||
ip6tables -t mangle -D FORWARD -o br-lan -j DSCP --set-dscp 0
|
||||
echo "10 0" > /sys/kernel/debug/hnat/hnat_setting
|
||||
echo "11 30" >/sys/kernel/debug/hnat/hnat_setting
|
||||
for i in $(seq 0 31); do
|
||||
echo 0 0 0 0 0 4 4 > $hqos_path/qdma_txq$i
|
||||
done
|
||||
for i in $(seq 32 63); do
|
||||
echo 1 0 0 0 0 4 4 > $hqos_path/qdma_txq$i
|
||||
done
|
||||
echo 0 wrr 10000000 > /sys/kernel/debug/hnat/qdma_sch0
|
||||
echo 0 wrr 10000000 > /sys/kernel/debug/hnat/qdma_sch1
|
||||
echo 0 wrr 10000000 > /sys/kernel/debug/hnat/qdma_sch2
|
||||
echo 0 wrr 10000000 > /sys/kernel/debug/hnat/qdma_sch3
|
||||
;;
|
||||
"start")
|
||||
stop_qos
|
||||
@ -62,10 +67,11 @@ case "$1" in
|
||||
echo 1 > /sys/kernel/debug/hnat/qos_toggle
|
||||
echo 0 wrr 10000000 > /sys/kernel/debug/hnat/qdma_sch0
|
||||
echo 0 wrr 10000000 > /sys/kernel/debug/hnat/qdma_sch1
|
||||
echo 0 wrr 10000000 > /sys/kernel/debug/hnat/qdma_sch2
|
||||
echo 0 wrr 10000000 > /sys/kernel/debug/hnat/qdma_sch3
|
||||
echo 0 0 0 0 0 4 4 > /sys/kernel/debug/hnat/qdma_txq0
|
||||
echo 1 0 0 0 0 4 4 > /sys/kernel/debug/hnat/qdma_txq8
|
||||
echo 1 wrr $(($3*1000)) > /sys/kernel/debug/hnat/qdma_sch2
|
||||
echo 1 wrr $(($2*1000)) > /sys/kernel/debug/hnat/qdma_sch3
|
||||
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
|
||||
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
|
||||
@ -81,11 +87,11 @@ case "$1" in
|
||||
iptables -t mangle -D eqos -s $ip -j DSCP --set-dscp ${id}
|
||||
iptables -t mangle -D eqos -d $ip -j DSCP --set-dscp ${idpair}
|
||||
if [ $up -ne 0 ]; then
|
||||
echo 2 0 0 1 ${up} 4 4 > /sys/kernel/debug/hnat/qdma_txq${id}
|
||||
echo 2 0 0 1 ${up} 4 1 > /sys/kernel/debug/hnat/qdma_txq${id}
|
||||
iptables -t mangle -A eqos -s $ip -j DSCP --set-dscp ${id}
|
||||
fi
|
||||
if [ $dl -ne 0 ]; then
|
||||
echo 2 0 0 1 ${dl} 4 4 > /sys/kernel/debug/hnat/qdma_txq${idpair}
|
||||
echo 3 0 0 1 ${dl} 4 1 > /sys/kernel/debug/hnat/qdma_txq${idpair}
|
||||
iptables -t mangle -A eqos -d $ip -j DSCP --set-dscp ${idpair}
|
||||
fi
|
||||
else
|
||||
|
@ -574,6 +574,7 @@ int cr_set_usage(int level)
|
||||
pr_info(" 8 0~1 Set hnat disable/enable ipv6\n");
|
||||
pr_info(" 9 0~1 Set hnat disable/enable guest (rax1/ra1)\n");
|
||||
pr_info(" 10 0~1 Set hnat disable/enable dscp setting\n");
|
||||
pr_info(" 11 1~30 Set hnat band rate\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -719,6 +720,25 @@ int set_dscp_toggle(int toggle)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bind_rate_setting(int bind_rate)
|
||||
{
|
||||
int i;
|
||||
|
||||
if ((bind_rate > 30) || (bind_rate <1)) {
|
||||
bind_rate = 30;
|
||||
pr_info("bind_rate max interval = 30\n");
|
||||
} else {
|
||||
pr_info("bind_rate = %d\n", bind_rate);
|
||||
}
|
||||
|
||||
/* Keep alive timer for bind FOE UDP entry */
|
||||
for (i = 0; i < CFG_PPE_NUM; i++)
|
||||
cr_set_field(hnat_priv->ppe_base[i] + PPE_BNDR, BIND_RATE, bind_rate);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void mtk_ppe_dev_hook(const char *name, int toggle)
|
||||
{
|
||||
struct net_device *dev;
|
||||
@ -772,7 +792,7 @@ static const debugfs_write_func cr_set_func[] = {
|
||||
[4] = udp_bind_lifetime, [5] = tcp_keep_alive,
|
||||
[6] = udp_keep_alive, [7] = set_nf_update_toggle,
|
||||
[8] = set_ipv6_toggle, [9] = set_guest_toggle,
|
||||
[10] = set_dscp_toggle,
|
||||
[10] = set_dscp_toggle, [11] = bind_rate_setting,
|
||||
};
|
||||
|
||||
int read_mib(struct mtk_hnat *h, u32 ppe_id,
|
||||
@ -1551,6 +1571,7 @@ ssize_t hnat_setting_write(struct file *file, const char __user *buffer,
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
p_token = strsep(&p_buf, p_delimiter);
|
||||
if (!p_token)
|
||||
arg1 = 0;
|
||||
|
@ -1416,6 +1416,8 @@ static unsigned int skb_to_hnat_info(struct sk_buff *skb,
|
||||
entry.ipv6_5t_route.iblk2.dscp =
|
||||
(ip6h->priority << 4 |
|
||||
(ip6h->flow_lbl[0] >> 4));
|
||||
dscp = (ip6h->priority << 4 |
|
||||
(ip6h->flow_lbl[0] >> 4));
|
||||
break;
|
||||
|
||||
case NEXTHDR_IPIP:
|
||||
|
Loading…
x
Reference in New Issue
Block a user