Hardware NAT For LEDE

Ah yes, that's a lot of help

Oh I mean I run into problems when running ./patch_LEDE.sh
This might need to be updated?

001-mips-cflag-optimization.patch
002-mips74kc-set-optimization.patch

Also I'm not sure about patch #003-005, I just know for sure those 2 files are causing problems, I removed #001-005 to test out the other patches and it seems to be fine

Here's a snippet of target/linux/ar71xx/Makefile

ARCH:=mips
BOARD:=ar71xx
BOARDNAME:=Atheros AR7xxx/AR9xxx
FEATURES:=
CPU_TYPE:=24kc
SUBTARGETS:=generic nand mikrotik

versus your patch

 ARCH:=mips
 BOARD:=ar71xx
 BOARDNAME:=Atheros AR7xxx/AR9xxx
-FEATURES:=mips16 usbgadget
-CPU_TYPE:=24kc
+FEATURES:=usbgadget
+CPU_TYPE=74kc
+CPU_SUBTYPE:=dsp2
 SUBTARGETS:=generic nand mikrotik

13 hours ago Felix Fietkau build: remove mips16 feature flag from target makefiles blob | commitdiff
13 hours ago Felix Fietkau x86: unify CPU_TYPE for legacy and geode blob | commitdiff
13 hours ago Felix Fietkau build: remove mips16 feature flag from target makefiles blob | commitdiff | diff to current
13 hours ago Felix Fietkau build: remove obsolete mips32r2 CPU_TYPE
The devs changed that 13 hours ago that is why it failed.
You are just unlucky
That is why I put them in patches so when things change upstream I will know and it is easy to fix

I will update the patch when I get back home

:heart_eyes:

Fixed the 2 patches

How would I go about adding dependencies, I'm trying to follow instructions on stackoverflow with similar problems and can't find a clue

This is for building kmod-qca-ssdk-nohnat for my WDR3600 and WNDR3700V4 Router. Building kmod-qca-ssdk-hnat runs into no issues btw

chmod 0755 /home/user/source/build_dir/target-mips_74kc+dsp2_musl-1.1.15/linux-ar71xx_nand/qca-ssdk-g37060c2/ipkg-mips_74kc_dsp2/kmod-qca-ssdk-nohnat/CONTROL/postinst-pkg; fi
find /home/user/source/build_dir/target-mips_74kc+dsp2_musl-1.1.15/linux-ar71xx_nand/qca-ssdk-g37060c2/ipkg-mips_74kc_dsp2/kmod-qca-ssdk-nohnat -name 'CVS' -o -name '.svn' -o -name '.#*' -o -name '*~'| xargs -r rm -rf
Package kmod-qca-ssdk-nohnat is missing dependencies for the following libraries:
nf_conntrack.ko
ppp_generic.ko
Makefile:133: recipe for target '/home/user/source/bin/targets/ar71xx/nand/packages/kmod-qca-ssdk-nohnat_4.4.44+g37060c2-1_mips_74kc_dsp2.ipk' failed
make[3]: *** [/home/user/source/bin/targets/ar71xx/nand/packages/kmod-qca-ssdk-nohnat_4.4.44+g37060c2-1_mips_74kc_dsp2.ipk] Error 1
make[3]: Leaving directory '/home/user/source/package/ssdk/qca-ssdk'
package/Makefile:105: recipe for target 'package/ssdk/qca-ssdk/compile' failed
make[2]: *** [package/ssdk/qca-ssdk/compile] Error 2
make[2]: Leaving directory '/home/user/source'
package/Makefile:101: recipe for target '/home/user/source/staging_dir/target-mips_74kc+dsp2_musl-1.1.15/stamp/.package_compile' failed
make[1]: *** [/home/user/source/staging_dir/target-mips_74kc+dsp2_musl-1.1.15/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/user/source'
/home/user/source/include/toplevel.mk:197: recipe for target 'world' failed
make: *** [world] Error 2

The nf_conntrack.ko module is provided by kmod-nf-conntrack and ppp_generic.ko is provided by kmod-ppp.

Add DEPENDS := kmod-nf-conntrack kmod-ppp to your define KernelPackage and the dependency errors should disappear.

Fixed nohnat using jow's advice. Thanks
More importantly integration with LEDE is needed

Document Syntax Examples

Works ty!

This would be awesome!

EDIT: I had a quick test with kmod-qca-ssdk-nohnat and after a few minutes after boots the wireless AP would completely disappear, LEDs for both 2.4 and 5ghz remained on. Doing a power cycle recovers AP momentarily but disappears again. I didnt look too much into the logs but it might be because my setup is Client+AP. I'm going back to my old config for now and may do more testing later.

EDIT: Solved below

Hardware NAT is probably not related to that. You might be looking at bug #432.

I'll attempt to remove the patches from your link and do further testing

EDIT: Solved below

Don't remove anything manually, use git revert with the commit hash to undo the commit.

Best practice is creating a local branch so next time you pull updates for master there are no conflicts:

$ git branch test
$ git checkout test
$ git revert $commit_hash

If you want to continue using the branch with updated sources, do:

$ git checkout master
$ git pull
$ git checkout test
$ git rebase master

Once things are fixed you can delete your local branch and resume building from master.

Thank you for the heads up, I actually removed patches #354-357 to test and the wireless went back to normal! To note, this also includes the kmod-qca-ssdk-nohnat which is awesome

Referencing:

Sorry, my advice was meant for just rolling back and continue building. If you want to help testing, obviously nbd's procedure is the way to go.

Oh no, your comment was perfectly fine, I just had no idea how to roll back initially and wanted to find a quick fix

Thank you, much appreciated

But LEDE is already no hwnat why would you still want no hwnat?

just for the sake of stability and performance comparison :slight_smile:

Yea I understand where you are coming from but even so I believe it is still using LEDE Default NAT

Oh hmmm, so the following log doesn't really tell me much? is there a way to check?

Thu Jan 26 09:16:59 2017 kern.warn kernel: [   11.149241] ssdk_plat_init start
Thu Jan 26 09:16:59 2017 kern.warn kernel: [   11.152857] Register QCA PHY driver
Thu Jan 26 09:16:59 2017 kern.warn kernel: [   11.158000] PHY ID is 0x4dd034
Thu Jan 26 09:16:59 2017 kern.warn kernel: [   11.225509] qca probe f1 phy driver succeeded!
Thu Jan 26 09:16:59 2017 kern.warn kernel: [   11.230035] qca-ssdk module init succeeded!
Thu Jan 26 09:16:59 2017 kern.info kernel: [   11.237959] tun: Universal TUN/TAP device driver, 1.6

You misunderstood porting the 2 package over doesn't automatically enable NAT.
Rather you need to modify the switch registers to activate HW NaT
Previously there is no way because LEDE switch driver does not have the driver function but now you can with QCA SSDK
You can use ssdk_h shell to key in commands to configure the switch HWNAT.
Look at the PDFs in the repo
This is going to be the bulk of work getting it usable