bricco1981 / MT7622-mtkwifi

21 stars 8 forks source link

How to enable Fast-NAT support(MTK_APSOC_WIFI_FAST_NAT_SUPPORT)? #3

Open hpx502766238 opened 5 months ago

hpx502766238 commented 5 months ago

I have tried to enable this function in menuconfig,but failed to build:"xxx is not defined".It seems to lack of some dependencies. Can you fix it? I guess the sourcecode from padavanonly may offer a help: package/mtk/mt7622/Makefile

hpx502766238 commented 2 months ago

and if you enable hardware and software offload in firewall? no difference on wireless side?

very strange situation.

if you tell me how i can sent you this stuff i'll sent you. so we will have two eyes on that.

3.you can send stuff to my email,502766238@qq.com.

bricco1981 commented 2 months ago

you can check now

hpx502766238 commented 2 months ago

you can check now

ok,I received.

hpx502766238 commented 2 months ago

you can check now

Is the wifi driver you send to me different from your current github repo?I found some differences,it seems to be an older driver,similar to padavanonly.

bricco1981 commented 2 months ago

I do not remember,if you think so use the one on the repo,and add the needed files.

hpx502766238 commented 2 months ago

I do not remember,if you think so use the one on the repo,and add the needed files.

I compiled a new firmware with lede,kernel 5.10.214(same kernel version with Openwrt22.03 Snapshot).At present,the "wlan to wan" situation works fine,and I don't need to turn on the linux flowoffload.I am not at home now and cannot perform a test for the whnat situation.I plan to perform it after 15 days. About your question " if you enable hardware and software offload in firewall?".the answer is no.I guess the reason why you need to turn on it on openwrt 22.03.6 is that you may use an outdated mtk/mt7622/files/mtkhnat.ko which is from old hnat driver when compiled with wireless drivers. Instead,I added these to wireless driver Makefile: define KernelPackage/mt_wifi CATEGORY:=Kernel modules TITLE:=MTK wifi AP driver ifneq ($(CONFIG_MTK_FAST_NAT_SUPPORT), ) ifneq ($(CONFIG_NET_MEDIATEK_HNAT), ) DEPENDS+=+kmod-mediatek_hnat endif endif ifneq ($(CONFIG_MTK_WHNAT_SUPPORT), ) ifneq ($(CONFIG_MTK_WARP_V2), ) so the wireless driver was compiled with the newest mtkhnat.ko which was generated by mtksdk.

bricco1981 commented 2 months ago

show the full makefile please i have a mess here.

hpx502766238 commented 2 months ago

show the full makefile please i have a mess here. mt7622 https://github.com/hpx502766238/lede-R24.4.4-MTK/blob/5f25e5faa46dc37643fa6d578bcaee8e0c694755/package/mtk/mt7622/Makefile mt7915 https://github.com/hpx502766238/lede-R24.4.4-MTK/blob/5f25e5faa46dc37643fa6d578bcaee8e0c694755/package/mtk/mt7915/Makefile

bricco1981 commented 2 months ago

so how you know that it's working fine if you cannot test it? lol, just curios. thanks, so you think we are on the good way to make wireless side better?

hpx502766238 commented 2 months ago

so how you know that it's working fine if you cannot test it? lol, just curios. thanks, so you think we are on the good way to make wireless side better?

I only tested for "wlan to wan" situation just now,not all situations. At present,it's working fine on this situation,with an average speed 750M for downlink and 650M for uplink.CPU usage never exceed 25%. The wireless is much better than ever. Yes, we are on the right track. I guess the key factor impacting the speed of whnat might be the APCLI MIMO settings. I believe it will work well when I test it again at home next time.

bricco1981 commented 2 months ago

yes all setting for apcli, and i think is good to force it to mode=17 that's what i'm looking too. but still i cannot do a real test. i do not have that speed

bricco1981 commented 2 months ago

even with new makefiles it do not work right on 22.03.6 i need enable software and hardware nat. this on wwan.

hpx502766238 commented 2 months ago

you can check now

the mtksdk seems to be published before 2021,Nov.Because it has an option called CONFIG_NET_MEDIATEK_HW_QOS,refer to the date of this commit https://github.com/hpx502766238/mtk-openwrt-feeds/commit/24948202fa3e722a5f2d8dc05044e2f10d30bd7a. so if I want to use this version of hqos,how to do?Is there any instruction files?

hpx502766238 commented 2 months ago

even with new makefiles it do not work right on 22.03.6 i need enable software and hardware nat. this on wwan.

About whnat,I will make a full test this weekend.You can try op22.03 snapshot with kernel version 5.10.214 instead if mtkhnat didn't take effect by default.

bricco1981 commented 2 months ago

well, i'm reading the code a bit and i think the easy way is to stay on openwrt 22.03.2 because the /etc/firewall.user is working. on later version of openwrt you need adapt nftables to iptables. it' my guess

hpx502766238 commented 2 months ago

well, i'm reading the code a bit and i think the easy way is to stay on openwrt 22.03.2 because the /etc/firewall.user is working. on later version of openwrt you need adapt nftables to iptables. it' my guess

The test is done.The result is as follows: 5G WLAN TEST Network topology: PC1(iperf3 client:192.168.6.100)-(wireless connection 192.168.6.x)-AX6S(firmware test device)-(cable connection 192.168.31.x)-AX6S(stable firmware)-PC2(iperf3 server:192.168.1.3) wlan negotiation speed:1201/1134 Mbit/s(2x2mimo)

1.1 uplink(4tcp connection): 700M cpu 20%(cpu0 is 40%,ksoftirqd/0 10%;cpu1 is 1%)

1.2 downlink(4tcp connection): 750M,cpu 20%(cpu0 is 40%,ksoftirqd/0 15%,cpu1 is 1%)

5G WWAN TEST ApCli settings: ApCliMuMimoDlEnable=1 ApCliMuMimoUlEnable=1 ApCliMuOfdmaDlEnable=1 ApCliMuOfdmaUlEnable=1 WHNAT=1

1.LAN(switch)-WWAN(apclii0) (WHNAT) test: Network topology: PC1(iperf3 client)-(cable connection 192.168.6.x)-AX6S(firmware test device)-(wireless connection 192.168.31.x)-AX6S(stable firmware)-PC2(iperf3 server 192.168.1.3) wwan negotiation speed:1921/1921 Mbit/s(4x4mimo)

1.1 uplink(4tcp connection)(first time test after system reboot) : 890M cpu 30%(cpu0 is 60%,ksoftirqd/0 15%;cpu1 is 1%)

1.2 downlink(4tcp connection)(first time test after system reboot,seems that whnat does not take effect): 685M,cpu 50%(cpu0 is 100%,ksoftirqd/0 96%,cpu1 is 1%)

1.3 uplink(4tcp connection) (second time test after 1 client connected to rai0): 890M cpu 20%(cpu0 is 40%,ksoftirqd/0 3%;cpu1 is 1%)

1.4 downlink(4tcp connection)(second time test after 1 client connected to rai0): 910M,cpu 35%(cpu0 is 70%,ksoftirqd/0 35%,cpu1 is 1%)

2.WLAN(rai0,2x2mimo)-WWAN(apclii0,4x4mimo) (WHNAT) test: Network topology: PC1(iperf3 client)-(wireless connection 192.168.6.x)-AX6S(firmware test device)-(wireless connection 192.168.31.x)-AX6S(stable firmware)-PC2(iperf3 server 192.168.1.3) wwan negotiation speed:1921/1921 Mbit/s(4x4mimo)

2.1 uplink(4tcp connection) : 450M cpu 25%(cpu0 is 50%,ksoftirqd/0 6%;cpu1 is 2%)

2.2 downlink(4tcp connection) : 390M cpu 30%(cpu0 is 60%,ksoftirqd/0 10%;cpu1 is 2%)

hpx502766238 commented 2 months ago

As a conclusion, there are still some small issues: 1.We need an extra client connected to rai0 to activate some parts of hardware acceleration; otherwise, the whnat doesn’t take effect. (I found a new process named “kworker/0:0-events” after rai0 is connected.) 2.CPU0 is busy all the time, meanwhile CPU1 is free. We need a balance script to allocate works more sensibly.

bricco1981 commented 2 months ago

hi is whnat working whitout enabling hardware and software offload?

hpx502766238 commented 2 months ago

hi is whnat working whitout enabling hardware and software offload?

Yes, it was working without enabling Linux offload. I am not sure if it was due to the version of iptables I was using. https://github.com/hpx502766238/lede-R24.4.4-MTK/blob/mtksdk/package/network/utils/iptables/Makefile

bricco1981 commented 2 months ago

ok that's why, if you are on iptables you can fix easy the cpu oveload

hpx502766238 commented 2 months ago

ok that's why, if you are on iptables you can fix easy the cpu oveload

Is there any newer hnat driver? The current version seems not to support HQoS.

bricco1981 commented 2 months ago

i think you need and old HQos, check this https://github.com/padavanonly/immortalwrtARM/tree/92b71da50a8cbea84333c02959e0aa12504e8495/package/mtk

hpx502766238 commented 2 months ago

i think you need and old HQos, check this https://github.com/padavanonly/immortalwrtARM/tree/92b71da50a8cbea84333c02959e0aa12504e8495/package/mtk

Do I need to set CONFIG_NET_MEDIATEK_HW_QOS=y in config-5.10?I had set it but met a compile error,so I disabled.

bricco1981 commented 2 months ago

So just do not set it