Qualcomm Fast Path For LEDE

I successfully compiled from latest trunk (MT7621), also added the "all-in-one"patch from
https://github.com/dissent1/r7800/commit/4ed549dc60f984891fce43d163b77462f07dc025.patch
to pending-4.4 & pending-4.9.
But now i need a HOWTO to enable Fast-Path.

Any help?

Fast Path is platform agnostic, it simply offloads processing of traffic with no complex rules out of the kernel networking stack and into a far more optimised path.

Simply apply the path in the pull request dissent1 has open against the main lede source on github, compile for your arch (ensuring you select the fastpath module in make menuconfig) and flash ... it's as simple as that.

It's enabled by default if you selected the correct packages in make menuconfig

can you copy and paste the output of

cat /sys/fast_classifier/debug_info

as that will show us if it's processing anything or not.

So, I have not actually looked at the code, but...
I would expect that not using the kernel stack will force the user to give up a few of the bells and whistles the kernel stack offers. That might still be a decent trade-off, but saying Fast Path offers:

seems to imply the kernel stack would not also be optimzed (to some degree).
Anybody knows the chance of getting that module up-streamed into the kernel proper?

Best Regards

Thanks for your help.

Clarification:
Copy the patch to target/linux/generic/pending-4.9
make menuconfig (there´s no such packages!)

cat /sys/fast_classifier/debug_info shows:
cat: can't open '/sys/fast_classifier/debug_info': No such file or directory

No, you need to download the patch from github (posted a few replies above) and then apply that to your checkout of the lede source, e.g.

wget https://patch-diff.githubusercontent.com/raw/lede-project/source/pull/1269.patch
git apply --ignore-space-change --ignore-whitespace 1269.patch

then in menuconfig

Kernel Modules > Network Support > kmod-fast-classifier and kmod-shortcut-fe (not kmod-shortcut-fe-cm)

4 Likes

Anything too complex for simple offloading is still handled by the kernel. It's quite clever - it hooks into the network stack so it gets notified of any routing table changes, and anything it can handle it does, anything it can't it lets continue through the default stack.

And that's correct, the Linux Kernel Network Stack is a very generic networking stack that's meant to be used by a wide variety of different devices, if it was massively optimised we wouldn't need fast-path or hardware network acceleration.

Maybe @dissent1 can try the netdev mailing list? (https://www.kernel.org/doc/Documentation/networking/netdev-FAQ.txt)

Cheers.

It's already in the Qualcomm Code Aurora git repo IIRC, and they occasionally push things upstream, but I'm not sure how much traction this would get for landing in the mainline kernel.

@philjohn,
Thanks for this instructions!
If I want to revert this PR, what I need to do?

@philjohn,

many thanks for your instructions!
Implemented it on Ubiquiti Edgerouter ER-X with LEDE latest trunk and get easily 930MBit NAT-Performance (quick test).

You can either use:

git reset --hard HEAD

or just run make menuconfig again and unselect the two kmod's, then build

You can also simply up-apply "revert" the commit as a patch

patch -R -p 1 -i patchfile

@philjohn

wget https://patch-diff.githubusercontent.com/raw/lede-project/source/pull/1269.patch
git apply --ignore-space-change --ignore-whitespace 1269.patch

then in menuconfig

Kernel Modules > Network Support > kmod-fast-classifier and kmod-shortcut-fe (not kmod-shortcut-fe-cm)

I just did this, and the build was fine for my Archer C7v2. However, I had a problem with my VPN setup (IPsec roadwarrior config using Strongswan): I can VPN into my router just fine, but I could not connect to an RDP session behind my router (rdp-client --> ipsec tunnel over internet --> VPN server on router --> RDP server in local LAN)

The rdp connection would start, but then disconnect after about 10 seconds. I needed to do "rmmod fast-classifier" to get everything stable again.

Before the rmmod, fast path seemed to be working ok:

root@router ~# cat /sys/fast_classifier/exceptions
NO_IIF = 12682
NO_CT = 1
CT_NO_CONFIRM = 727
TCP_NOT_ASSURED = 186
WAIT_FOR_ACCELERATION = 10445
CT_DESTROY_MISS = 1220
root@router ~# head -n1 /sys/fast_classifier/debug_info
size=84 offload=0 offload_no_match=0 offloaded=41 done=39 offl_dbg_msg_fail=41 done_dbg_msg_fail=39

Any idea what could be wrong?

I'm afraid I don't know, working fine here with an OpenVPN server running, but I've not used strongswan before (or even know much about it). Might be better contacting the upstream project on CodeAurora with the issue.

Thanks for the hint, but isn't this working with 'lede-17.01' branch? (I just tried out and there's no such option in Kernel config.)

Worked for me, did you follow the instructions explicitly?

Also, are you configuring the kernel directly (which is possible), or running make menuconfig in the root Lede checkout directory?

One thing - you may need to move the patches from hack-4.4 to patches-4.4 (look in the patch to see the full path)

That was it and also: 4.9 modifications have to be removed completely from it to be able to apply the patch on current lede-17.01 branch. (I haven't compiled it yet, but it should be fine.)
Thanks for your help!

So, do we know exactly how SFE should behave with SQM?
Thanks

is sqm and fastpath not the opposing tradeoffs?
as in:

sqm: use more cpu to better manage scare capacity/bandwith
fastpath: use less cpu to better handle high capacity (because cpu is too slow otherwise)