Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add band steering and 80211r #205

Open
wants to merge 18 commits into
base: openwrt-21.02
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion defconfig/mt7981-ax3000.config
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,13 @@ CONFIG_MTK_HDR_TRANS_TX_SUPPORT=y
CONFIG_MTK_ICAP_SUPPORT=y
CONFIG_MTK_IGMP_SNOOP_SUPPORT=y
CONFIG_MTK_INTERWORKING=y
CONFIG_MTK_BAND_STEERING=y
CONFIG_MTK_MAP_SUPPORT=y
CONFIG_MTK_MAP_R2_VER_SUPPORT=y
CONFIG_MTK_MAP_R3_VER_SUPPORT=y
CONFIG_MTK_MAP_SUPPORT=y
CONFIG_MTK_MAP_R2_6E_SUPPORT=y
CONFIG_MTK_MAP_R3_6E_SUPPORT=y
CONFIG_MTK_MBO_SUPPORT=y
CONFIG_MTK_MBSS_DTIM_SUPPORT=y
CONFIG_MTK_MBSS_SUPPORT=y
CONFIG_MTK_MCAST_RATE_SPECIFIC=y
Expand Down
5 changes: 4 additions & 1 deletion defconfig/mt7986-ax4200.config
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ CONFIG_MTK_HDR_TRANS_TX_SUPPORT=y
CONFIG_MTK_ICAP_SUPPORT=y
CONFIG_MTK_IGMP_SNOOP_SUPPORT=y
CONFIG_MTK_INTERWORKING=y
CONFIG_MTK_BAND_STEERING=y
CONFIG_MTK_MAP_SUPPORT=y
CONFIG_MTK_MAP_R2_VER_SUPPORT=y
CONFIG_MTK_MAP_R3_VER_SUPPORT=y
CONFIG_MTK_MAP_SUPPORT=y
CONFIG_MTK_MAP_R2_6E_SUPPORT=y
CONFIG_MTK_MAP_R3_6E_SUPPORT=y
CONFIG_MTK_MBSS_DTIM_SUPPORT=y
CONFIG_MTK_MBSS_SUPPORT=y
CONFIG_MTK_MCAST_RATE_SPECIFIC=y
Expand Down
5 changes: 4 additions & 1 deletion defconfig/mt7986-ax6000-256m.config
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ CONFIG_MTK_HDR_TRANS_TX_SUPPORT=y
CONFIG_MTK_ICAP_SUPPORT=y
CONFIG_MTK_IGMP_SNOOP_SUPPORT=y
CONFIG_MTK_INTERWORKING=y
CONFIG_MTK_BAND_STEERING=y
CONFIG_MTK_MAP_SUPPORT=y
CONFIG_MTK_MAP_R2_VER_SUPPORT=y
CONFIG_MTK_MAP_R3_VER_SUPPORT=y
CONFIG_MTK_MAP_SUPPORT=y
CONFIG_MTK_MAP_R2_6E_SUPPORT=y
CONFIG_MTK_MAP_R3_6E_SUPPORT=y
CONFIG_MTK_MBSS_DTIM_SUPPORT=y
CONFIG_MTK_MBSS_SUPPORT=y
CONFIG_MTK_MCAST_RATE_SPECIFIC=y
Expand Down
5 changes: 4 additions & 1 deletion defconfig/mt7986-ax6000.config
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@ CONFIG_MTK_HDR_TRANS_TX_SUPPORT=y
CONFIG_MTK_ICAP_SUPPORT=y
CONFIG_MTK_IGMP_SNOOP_SUPPORT=y
CONFIG_MTK_INTERWORKING=y
CONFIG_MTK_BAND_STEERING=y
CONFIG_MTK_MAP_SUPPORT=y
CONFIG_MTK_MAP_R2_VER_SUPPORT=y
CONFIG_MTK_MAP_R3_VER_SUPPORT=y
CONFIG_MTK_MAP_SUPPORT=y
CONFIG_MTK_MAP_R2_6E_SUPPORT=y
CONFIG_MTK_MAP_R3_6E_SUPPORT=y
CONFIG_MTK_MBSS_DTIM_SUPPORT=y
CONFIG_MTK_MBSS_SUPPORT=y
CONFIG_MTK_MCAST_RATE_SPECIFIC=y
Expand Down
2 changes: 1 addition & 1 deletion package/mtk/applications/luci-app-eqos-mtk/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk

LUCI_TITLE:=LuCI support for Easy QoS
LUCI_DEPENDS:=+tc +kmod-sched-core +kmod-ifb @!PACKAGE_luci-app-eqos
LUCI_DEPENDS:=+tc +kmod-sched-core +kmod-ifb @!PACKAGE_luci-app-eqos

PKG_MAINTAINER:=Jianhui Zhao <[email protected]>
PKG_NAME:=luci-app-eqos-mtk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,19 @@ return view.extend({
o.default = o.disabled;
o.rmempty = false;

o = s.option(form.Value, 'interface', _('Load balance'),
_('Please set a different gateway hop for each network interface before filling in the network interface name. Fill in PPPOE-WAN for dialing and eth1 for DHCP. Leaving it blank to disable it.Please use commas as interface name separators. Example: pppoe-wan,eth1'));
o.rmempty = true;

o = s.option(form.Flag, 'ipv6enabled', _('IPV6Enable'));
o.default = o.disabled;
o.rmempty = false;


o = s.option(form.Flag, 'smarthqos', _('SMART_HWQOS'),
_('Enabling fair queue will automatically perform hardware offloading and forwarding for small packets, P2P downloads, and web browsing. After enabling, the maximum number available for IP speed limit will be limited to 25.'));
o.default = o.disabled;
o.rmempty = false;

o = s.option(form.Value, 'download', _('Download speed (Mbit/s)'),
_('Total download bandwidth.'));
o.datatype = 'and(uinteger,min(1))';
Expand All @@ -37,8 +46,10 @@ return view.extend({
_('Total upload bandwidth.'));
o.datatype = 'and(uinteger,min(1))';
o.rmempty = false;



s = m.section(form.TableSection, 'device', _('Speed limit based on IP address(using unique comment less than 32 will enable hardware QOS)'));
s = m.section(form.TableSection, 'device', _('Speed limit and route choose based on IP address(using unique comment less than 32 will enable hardware QOS)'));
s.addremove = true;
s.anonymous = true;
s.sortable = true;
Expand All @@ -54,7 +65,7 @@ return view.extend({
var ip_addr = i[1].ipaddrs[v], ip_host = i[1].name;
o.value(ip_addr, ip_host ? String.format('%s (%s)', ip_host, ip_addr) : ip_addr)
}
o.rmempty = false;
o.rmempty = true;

var hosts = data[1]?.hosts;
o = s.option(form.Value, 'mac', _('IPV6 host'));
Expand All @@ -76,6 +87,10 @@ return view.extend({
o = s.option(form.Value, 'comment', _('Comment'));
o.datatype = 'and(uinteger,min(1))';
o.rmempty = false;

o = s.option(form.Value, 'interfacename', _('InterfaceName(start from 0)'));
o.datatype = 'and(uinteger,min(0))';
o.rmempty = true;

return m.render();
}
Expand Down
80 changes: 56 additions & 24 deletions package/mtk/applications/luci-app-eqos-mtk/po/templates/eqos.pot
Original file line number Diff line number Diff line change
@@ -1,62 +1,94 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"

#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:64
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:87
msgid "Comment"
msgstr ""

#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:28
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:40
msgid "Download speed (Mbit/s)"
msgstr ""

#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:18
#: applications/luci-app-eqos/root/usr/share/luci/menu.d/luci-app-eqos.json:3
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:79
msgid "Download speed (kbit/s)"
msgstr ""

#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:18
#: package/mtk/applications/luci-app-eqos-mtk/root/usr/share/luci/menu.d/luci-app-eqos.json:3
msgid "EQoS"
msgstr ""

#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:24
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:43
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:23
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:57
msgid "Enable"
msgstr ""

msgid "IPV6Enable"
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:36
msgid ""
"Enabling fair queue will automatically perform hardware offloading and "
"forwarding for small packets, P2P downloads, and web browsing. After "
"enabling, the maximum number available for IP speed limit will be limited to "
"25."
msgstr ""

#: applications/luci-app-eqos/root/usr/share/rpcd/acl.d/luci-app-eqos.json:3
#: package/mtk/applications/luci-app-eqos-mtk/root/usr/share/rpcd/acl.d/luci-app-eqos.json:3
msgid "Grant UCI access for luci-app-eqos"
msgstr ""

#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:46
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:60
msgid "IPV4 address"
msgstr ""

#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:19
msgid "Network speed control service."
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:71
msgid "IPV6 host"
msgstr ""

#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:38
msgid "Speed limit based on IP address(using unique comment less than 32 will enable hardware QOS"
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:31
msgid "IPV6Enable"
msgstr ""

#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:29
msgid "Total download bandwidth."
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:91
msgid "InterfaceName(start from 0)"
msgstr ""

#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:34
msgid "Total upload bandwidth."
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:27
msgid "Load balance"
msgstr ""

#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:33
msgid "Upload speed (Mbit/s)"
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:19
msgid "Network speed control service.(Compatiable with Mediatek HNAT)"
msgstr ""

#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:56
msgid "Download speed (kbit/s)"
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:28
msgid ""
"Please set a different gateway hop for each network interface before filling "
"in the network interface name. Fill in PPPOE-WAN for dialing and eth1 for "
"DHCP. Leaving it blank to disable it.Please use commas as interface name "
"separators. Example: pppoe-wan,eth1"
msgstr ""

#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:60
msgid "Upload speed (kbit/s)"
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:35
msgid "SMART_HWQOS"
msgstr ""

msgid "IPV6 host"
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:52
msgid ""
"Speed limit and route choose based on IP address(using unique comment less "
"than 32 will enable hardware QOS)"
msgstr ""

#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:41
msgid "Total download bandwidth."
msgstr ""

#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:46
msgid "Total upload bandwidth."
msgstr ""

#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:45
msgid "Upload speed (Mbit/s)"
msgstr ""

#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:83
msgid "Upload speed (kbit/s)"
msgstr ""
24 changes: 22 additions & 2 deletions package/mtk/applications/luci-app-eqos-mtk/po/zh_Hans/eqos.po
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,20 @@ msgstr "网速控制"
msgid "Enable"
msgstr "启用"

msgid "SMART_HWQOS"
msgstr "智能硬件QOS"

msgid "Enabling fair queue will automatically perform hardware offloading and forwarding for small packets, P2P downloads, and web browsing. After enabling, the maximum number available for IP speed limit will be limited to 25."
msgstr "启用公平队列,将自动对小包、P2P下载、网页浏览进行硬件分流转发.启用后IP限速可用的最大编号将限制为25"

msgid "IPV6Enable"
msgstr "同时作用IPV6"

msgid "Load balance"
msgstr "负载均衡"

msgid "Please set a different gateway hop for each network interface before filling in the network interface name. Fill in PPPOE-WAN for dialing and eth1 for DHCP. Leaving it blank to disable it.Please use commas as interface name separators. Example: pppoe-wan,eth1"
msgstr "请先为每个网络接口设置不同的网关跃点后,再填写网络接口名。拨号填写PPPOE-WAN,DHCP则填写eth1。留空则不启用.请使用逗号作为接口名分隔符.例子:pppoe-wan, eth1"

#: applications/luci-app-eqos/root/usr/share/rpcd/acl.d/luci-app-eqos.json:3
msgid "Grant UCI access for luci-app-eqos"
Expand All @@ -42,13 +53,21 @@ msgstr "IPV4 地址"
msgid "IPV6 host"
msgstr "IPV6 主机"


msgid "Total download bandwidth."
msgstr "总下载带宽。"

msgid "InterfaceName(start from 0)"
msgstr "分流接口序号(从0开始,留空则负载均衡)"


#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:19
msgid "Network speed control service.(Compatiable with Mediatek HNAT)"
msgstr "网速控制服务(未设置限速主机可正常使用硬件加速)。"

#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:38
msgid "Speed limit based on IP address(using unique comment less than 32 will enable hardware QOS)"
msgstr "基于 IP 限速(设置小于32唯一编号将启用硬件QOS.速度设置为0则取消限速)"
msgid "Speed limit and route choose based on IP address(using unique comment less than 32 will enable hardware QOS)"
msgstr "基于 IP 分流限速(设置小于32唯一编号将启用硬件QOS.速度设置为0则取消限速)"

#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:29
msgid "Total download bandwidth."
Expand All @@ -69,3 +88,4 @@ msgstr "下载速度 (kbit/s)"
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:60
msgid "Upload speed (kbit/s)"
msgstr "上传速度 (kbit/s)"

Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/sh
[ "$ACTION" = "ifup" ] || exit 0
[ "$INTERFACE" = "lan" ] || exit 0

/etc/init.d/eqos start
70 changes: 65 additions & 5 deletions package/mtk/applications/luci-app-eqos-mtk/root/etc/init.d/eqos
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ parse_device() {
[ "$enabled" -eq "1" ] || return 1


local ip download upload comment mac
local ip download upload comment mac interfacename
config_get ip "$cfg" ip
config_get download "$cfg" "download"
config_get upload "$cfg" "upload"
config_get comment "$cfg" "comment"
config_get mac "$cfg" "mac"

eqos add "$ip" "$download" "$upload" "$comment" "$mac"
config_get interfacename "$cfg" "interfacename"
eqos add "$ip" "$download" "$upload" "$comment" "$mac" "$interfacename"
}

start_service() {
Expand All @@ -33,8 +33,9 @@ start_service() {
config_get download "config" "download"
config_get upload "config" "upload"
config_get comment "config" "comment"

eqos start "$download" "$upload" "$comment"
config_get smarthqos "config" "smarthqos"
config_get interface "config" "interface"
eqos start "$download" "$upload" "$comment"

local ipv6enabled
config_get_bool ipv6enabled "config" "ipv6enabled" "0"
Expand All @@ -48,11 +49,70 @@ start_service() {
ip6tables -t mangle -D FORWARD -j eqos
ip6tables -t mangle -A FORWARD -j eqos
fi

if [ "$smarthqos" -eq "1" ]; then
for i in $(seq 1 31); do
if [ "$upload" -ne "0" ]; then
echo 2 1 $(($upload*225)) 1 $(($upload*1000)) 4 1 > /sys/kernel/debug/hnat/qdma_txq$i
fi
done
for i in $(seq 33 63); do
if [ "$download" -ne "0" ]; then
echo 3 1 $(($download*200)) 1 $(($download*1000)) 4 1 > /sys/kernel/debug/hnat/qdma_txq$i
fi
done
echo 2 1 $(($upload*100)) 1 $(($upload*1000)) 4 1 > /sys/kernel/debug/hnat/qdma_txq30
echo 3 1 $(($download*150)) 1 $(($download*1000)) 4 1 > /sys/kernel/debug/hnat/qdma_txq62
echo 2 1 $(($upload*100)) 1 $(($upload*1000)) 4 1 > /sys/kernel/debug/hnat/qdma_txq27
echo 3 1 $(($download*150)) 1 $(($download*1000)) 4 1 > /sys/kernel/debug/hnat/qdma_txq59


iptables -t mangle -A eqos -i br-lan -p tcp -j DSCP --set-dscp 31
iptables -t mangle -A eqos -o br-lan -p tcp -j DSCP --set-dscp 63
iptables -t mangle -A eqos -i br-lan -p udp -j DSCP --set-dscp 30
iptables -t mangle -A eqos -o br-lan -p udp -j DSCP --set-dscp 62
iptables -t mangle -A eqos -i br-lan -p tcp --dport 80 -j DSCP --set-dscp 29
iptables -t mangle -A eqos -o br-lan -p tcp --dport 80 -j DSCP --set-dscp 61
iptables -t mangle -A eqos -o br-lan -p tcp --dport 443 -j DSCP --set-dscp 29
iptables -t mangle -A eqos -o br-lan -p tcp --dport 443 -j DSCP --set-dscp 61
iptables -t mangle -A eqos -i br-lan -p tcp --dport 8080 -j DSCP --set-dscp 29
iptables -t mangle -A eqos -o br-lan -p tcp --dport 8080 -j DSCP --set-dscp 61
iptables -t mangle -A eqos -i br-lan -p tcp --dport 8081 -j DSCP --set-dscp 29
iptables -t mangle -A eqos -o br-lan -p tcp --dport 8081 -j DSCP --set-dscp 61
iptables -t mangle -A eqos -i br-lan -m length --length :256 -j DSCP --set-dscp 28
iptables -t mangle -A eqos -o br-lan -m length --length :256 -j DSCP --set-dscp 60
iptables -t mangle -A eqos -i br-lan -p udp -m hashlimit --hashlimit-mode srcip,srcport --hashlimit-name udpout --hashlimit-above 5/sec --hashlimit-burst 5 --hashlimit-htable-expire 10000 --hashlimit-htable-gcinterval 10000 -j DSCP --set-dscp 27
iptables -t mangle -A eqos -o br-lan -p udp -m hashlimit --hashlimit-mode dstip,dstport --hashlimit-name udpin --hashlimit-above 5/sec --hashlimit-burst 5 --hashlimit-htable-expire 10000 --hashlimit-htable-gcinterval 10000 -j DSCP --set-dscp 59

ip6tables -t mangle -A eqos -i br-lan -j MARK --set-mark 31
ip6tables -t mangle -A eqos -o br-lan -j MARK --set-mark 63
ip6tables -t mangle -A eqos -p udp -i br-lan -j MARK --set-mark 30
ip6tables -t mangle -A eqos -p udp -o br-lan -j MARK --set-mark 62
ip6tables -t mangle -A eqos -i br-lan -p tcp --dport 80 -j MARK --set-mark 29
ip6tables -t mangle -A eqos -o br-lan -p tcp --dport 80 -j MARK --set-mark 61
ip6tables -t mangle -A eqos -i br-lan -p tcp --dport 443 -j MARK --set-mark 29
ip6tables -t mangle -A eqos -o br-lan -p tcp --dport 443 -j MARK --set-mark 61
ip6tables -t mangle -A eqos -i br-lan -p tcp --dport 8080 -j MARK --set-mark 29
ip6tables -t mangle -A eqos -o br-lan -p tcp --dport 8080 -j MARK --set-mark 61
ip6tables -t mangle -A eqos -i br-lan -p tcp --dport 8081 -j MARK --set-mark 29
ip6tables -t mangle -A eqos -o br-lan -p tcp --dport 8081 -j MARK --set-mark 61
ip6tables -t mangle -A eqos -i br-lan -m length --length :256 -j MARK --set-mark 28
ip6tables -t mangle -A eqos -o br-lan -m length --length :256 -j MARK --set-mark 60
ip6tables -t mangle -A eqos -i br-lan -p udp -m hashlimit --hashlimit-mode srcip,srcport --hashlimit-name udp6out --hashlimit-above 5/sec --hashlimit-burst 5 --hashlimit-htable-expire 10000 --hashlimit-htable-gcinterval 10000 -j MARK --set-mark 27
ip6tables -t mangle -A eqos -o br-lan -p udp -m hashlimit --hashlimit-mode dstip,dstport --hashlimit-name udp6in --hashlimit-above 5/sec --hashlimit-burst 5 --hashlimit-htable-expire 10000 --hashlimit-htable-gcinterval 10000 -j MARK --set-mark 59
fi
iptables -t mangle -F PREROUTING
if [ $interface ]; then
bash /usr/sbin/loadbalance "$interface"
fi

config_foreach parse_device "device"

}

stop_service() {
eqos stop
iptables -t mangle -F PREROUTING
}

reload_service() {
Expand Down
Loading