IPQ806x NSS Drivers

Just pull the latest commit from OpenWrt or apply that patch and recompile a new image.
Everything should work normal.

oh yes, i did that already, it fixed it but i couldn't see any effect. i think i needed the kmod-qca-nss-drv-pppoe module enabled.

I've been following this thread for a while now and am interested in trying out NSS offloading. Is there a guide to getting @Ansuel code properly rebased onto openwrt master? I found the following but in running it, I got a number merge conflicts:

% git status
interactive rebase in progress; onto aafbfc6ac3
Last commands done (3 commands done):
   pick 346dab6ea1 Add needed patch for nss driver
   pick 7b3855d6f8 Update target patches and config
  (see more in file .git/rebase-merge/done)
Next commands to do (59 remaining commands):
   pick ebdd97b8fe Use qsdk10.0 for crypto driver
   pick 862e32e568 Add qca-nss-cfi support
  (use "git rebase --edit-todo" to view and edit)
You are currently rebasing branch 'kernel5.4-nss-qsdk10.0' on 'aafbfc6ac3'.
  (fix conflicts and then run "git rebase --continue")
  (use "git rebase --skip" to skip this patch)
  (use "git rebase --abort" to check out the original branch)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	modified:   target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-r7800.dts

Unmerged paths:
  (use "git restore --staged <file>..." to unstage)
  (use "git add <file>..." to mark resolution)
	added by them:   target/linux/ipq806x/files/drivers/regulator/nss-volt-ipq806x.c
	added by them:   target/linux/ipq806x/files/include/linux/regulator/nss-volt-ipq806x.h
	added by them:   target/linux/ipq806x/files/include/net/netfilter/nf_conntrack_dscpremark_ext.h
	added by them:   target/linux/ipq806x/files/net/netfilter/nf_conntrack_dscpremark_ext.c

Hmmm. Still getting this. Can the NSS drivers be built with the 19.07.4 (stable) kernel? If so, I am willing to build this if I could get a bit of help. If it is a slight performance hit, it is better than rebooting, imo.

Weird. I just did a rebase using the same command and it works just fine.

Mmm... I know, @ACwifidude claimed it works too. Like I wrote earlier, i tried on 2 different machines. but I get the same conflicts that @darksky got.

1 Like

@darksky @shelterx

My repo is the same as Ansuel’s - just rebased. If it helps you can start from where I’m at.

git clone -b kernel5.4-nss-qsdk10.0  https://github.com/ACwifidude/openwrt.git nss
cd nss
git remote add upstream https://git.openwrt.org/openwrt/openwrt.git 
git fetch upstream && git rebase upstream/master && ./scripts/feeds update -a && ./scripts/feeds install -a

Edit the diffconfig to your liking and you are ready to build:


cp diffconfig .config && make defconfig

Thanks for the link. I am interested in learning how to get this rebased myself. Did you find the same errors I reported when you tried?

Unrelated question about the diffconfig: what are the minimum entries needed to use the NSS stuff? Just the 7 lines under that comment?

I didn’t have the same errors going from Ansuel’s when @shelterx was having issues a couple days back - didn’t get any errors. Don’t know why or what the difference is that the same command would do two different things :man_shrugging:

Yes - you just need those 7 packages to get wifi acceleration (it’ll pull in the NSS MAC 80211 package), SQM acceleration, and NAT hardware acceleration.

If you look on my post a few days ago, I shared a script that does pretty much everything for me.
I ran it last night which gave me a clean build on the first go
I do my build on a separate VM to make sure I don't change something inadvertently

Anyway did you checked if you have nss offload is enabled for mac80211? I have to fix the driver since it's currently broken with that flag disabled but i don't have so much time.

Wifi speed is good (avg 530-560mbps on download per speedtest) and CPU usage appears lower. If it is not fully offloading... I’d love to see how much quicker it could go. :grin:

Thank you, I am building now. Once flashed, is there anything in LuCI I need to do to enable NSS or are these things on by default?

The NSS acceleration just works - you don’t need to click the hardware acceleration box in luci (no luci checkboxes or special configuration needed).

I have software offloading turned off and performance governor on.

I had one device that my settings were very customized (wifi and IRQ settings were a little crazy...) - I had to reset to the default settings and everything was fine . Otherwise I had no issues with more normal config settings on my other 2 r7800’s.

1 Like

Pretty decent difference in terms of CPU% and download throughput.

iphone7:
Without NSS download speed was 325 Mbps with NSS it was 445 Mbps. Difference was seen in htop. Without NSS it was saturating one of the cores. With NSS it was 20-25% across both cores at the peak.

With an older Macbook Pro:
Without NSS download speed was 282 Mbps with NSS it was 415 Mbps. Difference was seen in htop. Without NSS it was saturating one of the cores. With NSS it was 78% at its peak on a single core (both in use).

Hardware is R7800 with QoS (fq_codel/simplest-tbf.qos).

For comparison, when i run speedtest-netperf.sh on the router, I get around 500 Mbps.

cd /path/to/my/openwrt-git/
./scripts/feeds update -a
./scripts/feeds install -a
git remote add nss https://github.com/ACwifidude/openwrt.git
git fetch nss
git checkout kernel5.4-nss-qsdk10.0
git fetch upstream && git rebase upstream/master

My config after adding the 7 lines mentioned above.

1 Like

Nice. I’m getting similar results.

For SQM to run with the NSS cores you’ll need to run custom scripts (I have these lines on my startup script - adjust to your speed as you see fit or comment them out).

The standard SQM config settings are not fully functional. NSS cores unfortunately do not support cake but they support fq codel up to nearly line rate (~900mbps). Ex:


# Shape ingress traffic to 500 Mbit with chained NSSFQ_CODEL
tc qdisc add dev nssifb root handle 1: nsstbl rate 500Mbit burst 1Mb
tc qdisc add dev nssifb parent 1: handle 10: nssfq_codel limit 10240 flows 1024 quantum 1514 target 5ms interval 100ms set_default

# Shape egress traffic to 34 Mbit with chained NSSFQ_CODEL
tc qdisc add dev eth0 root handle 1: nsstbl rate 34Mbit burst 1Mb
tc qdisc add dev eth0 parent 1: handle 10: nssfq_codel limit 10240 flows 1024 quantum 1514 target 5ms interval 100ms set_default

2 Likes

I didn't realize this... I have the d/l speed for SQM set to 650000 and the upload set to 22000. What values do you recommend in the startup script to match?

Easy adjustment - just change the number in front of the Mbit for the speed you desire. NSS can do more than 650 so feel free to go higher if you have more from your ISP.

# Shape ingress traffic to 650 Mbit with chained NSSFQ_CODEL
tc qdisc add dev nssifb root handle 1: nsstbl rate 650Mbit burst 1Mb
tc qdisc add dev nssifb parent 1: handle 10: nssfq_codel limit 10240 flows 1024 quantum 1514 target 5ms interval 100ms set_default

# Shape egress traffic to 22 Mbit with chained NSSFQ_CODEL
tc qdisc add dev eth0 root handle 1: nsstbl rate 22Mbit burst 1Mb
tc qdisc add dev eth0 parent 1: handle 10: nssfq_codel limit 10240 flows 1024 quantum 1514 target 5ms interval 100ms set_default

my experience with NSS is that if you have 'SQM' enabled, you don't have anything at all. i think with NSS it bypasses SQM?

I tried a variety of SQM settings and didn’t notice any change... then I found out NSS bypasses SQM. :laughing:

You’ll have to run the script to get shaping. :sunglasses:

Here is the start of the discussion: