Hardware NAT For LEDE

There are those 5 lines mentioning ssdk:

[ 58.181843] ssdk_plat_init start
[ 58.185618] Register QCA PHY driver
[ 58.191725] PHY ID is 0x4dd034
[ 58.291231] qca probe f1 phy driver succeeded!
[ 58.295749] qca-ssdk module init succeeded!

LEDE-17.01/April-2017-Image Add Archer C7 v2 with Hardware NAT
Bootloop after PPPoE connection.

Are you able to get any logs at all (I know it is difficult with bootloop)?
I do not have PPPoE so I cannot do any testing on that.

I can not get logs because the router reboots immediately after the pppoe connection is established. I tried factory reset and router works until pppoe setup.

PS
But before pppoe setup in log I see mentioned here lines.

@ReMicroN;

r00t has some great advice for debugging bootloop issues in another thread:

I connected over SSH and ran logread -f to watch the logs go by. Putty keeps the last messages open and ready to copy when the router disconnects.

kernel.panic might also be one of his custom sysctl settings, add it yourself if it's not in this version of the firmware.

@gwlim I ran some Archer C7 tests too. It looks like HW NAT is active and makes a difference, but right now I'm seeing a performance degradation. [tests removed because the degraded performance was caused by other factors]

NAT with other firmware - 484mb/s
NAT on the April NAT build - 395mb/s - with a lot of jitter in the speed

Direct switch connection - 891mb/s - probably not relevant but doing the extra test was easy

C7 Direct Switch-Switch

PS C:\Users\denis\Desktop\iperf-3.1.3-win64> .\iperf3.exe iperf -c 10.5.1.15
Connecting to host 10.5.1.15, port 5201
[  4] local 10.5.1.184 port 51425 connected to 10.5.1.15 port 5201
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-1.00   sec   106 MBytes   889 Mbits/sec
[  4]   1.00-2.00   sec   105 MBytes   882 Mbits/sec
[  4]   2.00-3.00   sec   106 MBytes   892 Mbits/sec
[  4]   3.00-4.00   sec   106 MBytes   893 Mbits/sec
[  4]   4.00-5.00   sec   106 MBytes   893 Mbits/sec
[  4]   5.00-6.00   sec   106 MBytes   892 Mbits/sec
[  4]   6.00-7.00   sec   106 MBytes   892 Mbits/sec
[  4]   7.00-8.00   sec   106 MBytes   893 Mbits/sec
[  4]   8.00-9.00   sec   106 MBytes   891 Mbits/sec
[  4]   9.00-10.00  sec   106 MBytes   891 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-10.00  sec  1.04 GBytes   891 Mbits/sec                  sender
[  4]   0.00-10.00  sec  1.04 GBytes   891 Mbits/sec                  receiver

C7 Without Hardware NAT

PS C:\Users\denis\Desktop\iperf-3.1.3-win64> .\iperf3.exe iperf -c 10.5.1.15
Connecting to host 10.5.1.15, port 5201
[  4] local 192.168.1.184 port 50634 connected to 10.5.1.15 port 5201
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-1.00   sec  59.8 MBytes   501 Mbits/sec
[  4]   1.00-2.00   sec  58.5 MBytes   491 Mbits/sec
[  4]   2.00-3.00   sec  59.5 MBytes   499 Mbits/sec
[  4]   3.00-4.00   sec  57.4 MBytes   481 Mbits/sec
[  4]   4.00-5.00   sec  59.6 MBytes   500 Mbits/sec
[  4]   5.00-6.00   sec  58.2 MBytes   489 Mbits/sec
[  4]   6.00-7.00   sec  49.4 MBytes   414 Mbits/sec
[  4]   7.00-8.00   sec  57.1 MBytes   479 Mbits/sec
[  4]   8.00-9.00   sec  59.4 MBytes   499 Mbits/sec
[  4]   9.00-10.00  sec  58.2 MBytes   489 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-10.00  sec   577 MBytes   484 Mbits/sec                  sender
[  4]   0.00-10.00  sec   577 MBytes   484 Mbits/sec                  receiver

C7 With Hardware NAT

<this test has been removed because I didn't account for other traffic on the network and it was innacurate>

I am suspecting the crash has to do with PPPoE multilink not selected because I remember patching PPPoE with Multi-link Export Symbols but the default PPP in LEDE is without MultiLink built. I will build 1 with multi-link later.

As for the jitter issue can I know what are the firmware you tested?
NAT with other firmware - 484mb/s <- Standard LEDE built or my LEDE patch but without NAT?
NAT on the April NAT build - 395mb/s - with a lot of jitter in the speed <- any other stuff that might impact performance like leaving the LuCI management Page open while doing the benchmark?

I am pretty sure NAT is not active at all until someone know the ssdk_sh commands (from the ssdk-shell).
the relevant entries should be visible in ssdk_sh if NAT is properly enabled.

Test builts with multilink enabled in ppp
https://github.com/gwlim/Openwrt_Firmware/tree/master/Mutilink-Test

It was r00t's custom C7 build, which is trunk from Apr 8 with a bunch of patches & optimizations but none of your HW NAT patches. Now that I think about it, that build might be showing better-than trunk performance because of the patches.

It's possible that there was something else going on, but would that make a 100mb/s difference?

.....

Now that I think about it, my internet line is 100m, so maybe my laptop decided to download updates while I was running the second test :expressionless:

I did check dmesg and saw the ssdk initialization messages in there, so that part is definitely working.

Reading through the whole thread again, it sounds like the process to enable HW NAT hasn't been totally figured out yet.

I'm happy to poke around in ssdk_sh and provide feedback on what I see for the C7, would love to get some guidance on what I'm looking for though.

Actually r00t incorporated some of my patches

lede-ar71xx-generic-tl-wdr3600-v1-squashfs-factory.bin Upload April LEDE Image

also crashes on pppoe

Please try the multi Link test binaries
If it still doesn't work I have to check again what is missing from LEDE PPP versus the CodeAuora PPP
https://github.com/gwlim/Openwrt_Firmware/tree/master/Mutilink-Test

WDR3600x1, PPPoE

just tried the multilink test, the same... i only tested w/o opening the box, and had a continuous ping on it
flashes ok, LAN client connects once done (ping ok) when i setup PPPoE it's also ok (ping ok), connects to the ISP and gets his config (WAN IP ...) the crazy stuff starts once i try to connect from a LAN client (the moment i try to open an Internet page), crashes and bootloops forever, seemingly random and only stays seconds so not enough time for flashing an old bin (safe at least). i remoted (fast :slight_smile: ) a ssh (Luci was inoperable) and did quickly a firstboot & reboot so that it restored the config to the w/o PPPoE so it was stable afterward and i could restore my previous firmware to it
i will open the box and put my UART on it and so i can grab some useful stuff (logs and so), i know just saying "not works" is not too much.

mine crashed on dhcp too, behind primary router

PPPoE as well?

sorry, right now I don't have access to it, is in a remote location and don't feel like testing a remote sysupgrade

regards

Ok I have isolated the issue to host_helper.c in qca-ssdk
It is a PPPoE code path
Apparently there is 2 code path to try the second code path does not require ppp patching
So there are 2 ways of solving this
1)Disable PPPoE Code
2)Try the second code path
Any Brave Soul with PPPoE wants to try?
To try you simply backup your existing config
Sysupgrade
If it fails do a reset then load your own config

https://github.com/gwlim/Openwrt_Firmware/tree/master/Mutilink-Test-2

Just tried, same behavior once PPPoE established. I was thinking you could setup your own PPPoE server and connect your router to it in order to check... this way you won't need us and you can see what's what.

later edit: made also a build from your git and ruled out everything related to luci and configured pppoe from uci, the same.. Well...I think will have to open the box and put that uart after all, darn.

To begin with, was interested in this because I wanted to put my USB tv tuner (+tvheadend/oscam) on my tplink3600 router, meanwhile I gave up to that thing. While I succeed (using a "normally" build, ie w/o the hnat patches) in compiling that stupid, unsupported MN88473 module for 4.4 and also the software and made everything work (unrestricted TV channels work fine) I will have to find a different way since it chokes on scrambled HD channels, simply not enough processing power (and i tried also the libdvbcsa which is supposedly faster than the tvhcsa that compiles as default in tvheadend) even when streaming an unscrambled channel it loads the processor to 30-40%, so when streaming a scrambled one it manages to do it for a few seconds, simply goes to 100% and chokes there then tvh segfaults (no wonder). Either way, this hwnat with a custom firmware like lede is interesting enough so ...

gwlim, outstanding work! The patches that you put together and all the optimizations - amazing! Thanks a lot!

I wanted to jump on the bandwagon and play with ssdk on my Link TL-WDR4300. Due to some kernel module dependencies (e.g. usb-storage, etc.) I could not use the image that you pre-built for us, since the kernel version had been switched on LEDE and official repo has old incompatible modules with your builds. So, I followed your instructions (https://github.com/gwlim/mips74k-ar71xx-lede-patch) and built locally my own image. Everything finished successfully and I've upgraded my TL-WDR4300 with the image.

Unfortunately, the image contained no traces of ssdk. So, I've started digging into what could be missing and initially thought that it was due to one of your recent changes (https://github.com/gwlim/mips74k-ar71xx-lede-patch/commit/9caf9980574beda834b220103155b89223f46fe7), but I was wrong and the build still did not compile ssdk pieces after I commented out line "sed '$d' feeds.conf.default".

When I unpacked your image, it contained the following files that not only were missing from my image, but also were not built locally (meaning that none of ssdk stuff was compiled by the build):
/etc/modules.d/30-qca-ssdk-hnat
/lib/modules/4.4.59/qca-ssdk.ko
/usr/lib/opkg/info/kmod-qca-ssdk-hnat.control
/usr/lib/opkg/info/kmod-qca-ssdk-hnat.list
/usr/lib/opkg/info/qca-ssdk-shell.control
/usr/lib/opkg/info/qca-ssdk-shell.list
/usr/sbin/ssdk_sh

Can you try building from scratch and see if everything builds fine in your environment, please? I could not figure out how ssdk was suppose to be included into the build, since it gets pulled as a feed, but then gets moved into "packages" folder. Is it supposed to be included into DEFAULT_PACKAGES in "include/target.mk" file to be noticed by the build?

Thanks!