Qualcomm Fast Path For LEDE

Would this work on Lantiq like https://wiki.openwrt.org/toh/bt/homehub_v5a ?

@jgvega After make menuconfig, what else needs to be selected besides the "Target System”, “Target Profile” ? Is the patch automatic selecting the right modules?

Hi.
Default Target is TL-WDR4300v1 in Gwlim's script.
You should change for your router model.

For example,I change TL-WRD3600v1 because it's my router model.

If you want to enable Fast Path select the fast path modules in

Kernel Modules > Network Support >

Select

kmod-fast-classifier

Save and exit.

To compile the image:

make V=s

@jgvega I have selected: Target System (Broadcom BCM47xx/53xx (ARM)), Target Profile (D-Link DIR-885L) and also selected kmod-fast-classifier plus a few more packages as in post 547, above. I am getting the bellow error. I am building on a Fedora 27 VM.

Error:
lede/build_dir/toolchain-arm_cortex-a9_gcc-6.3.0_musl-1.1.16_eabi/gcc-6.3.0/gcc/ubsan.c:1474:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
|| xloc.file == '\0' || xloc.file[0] == '\xff'
^~~~
make[5]: *** [Makefile:1085: ubsan.o] Error 1
make[5]: Leaving directory

Just wondering if this is the correct patch for my configuration:

git clone -b lede-17.01 https://github.com/gwlim/mips74k-lede-patch.git temp;mv temp/patch/066-wireguard-update.patch temp/broken; mv temp/* lede/; rm -rf temp

so is sqm still broken with sfe?

Clarification, sqm is not broken with sfe, but both are functionally mutually exclusive; I believe @dissent1's patch will disable sfe if there is an active sqm instance on an interface, while @gwlim's patch set will give priority to sfe and effectively disable sqm (or rather sqm will only see those ~128 packets the are needed to trigger the fast pathing). I do not believe this will change any time soon.

2 Likes

Gwlim's script is not compatible for ARM. Only MIPS arquitecture.
Probe dissent1's script.

I started with gwlim's patchset for Barrier Breaker 14.07, included fast path, cake as a scheduler and updated the kernel version to 3.10.107. Nevertheless basically all components of the firmware are outdated and I would not recommend to use it.
I can upload my modified patchset if you want but it is not fully automated and I can't give you any support on this.

Hi K3nny, very kind of you and thank you.

I would like to try your modified patchset if you have them uploaded somewhere.

Here is the download link: https://www.sendspace.com/file/54pdnb

Follow the instructions at gwlim's repository: https://github.com/gwlim/mips24k-barrier-breaker-patch/tree/f8f78bd8ddcf29f2a919063d71ed41ce6e9aa494 but instead of cloning his repository, copy the files from my patchset into the openwrt directory. The rest of the instructions remains basically the same.

Start building the firmware and the process should break while compiling the packages shortcut-fe or kmod-sched-cake. You need to compile them separately with:

make V=s package/kernel/shortcut-fe/clean
make V=s package/kernel/shortcut-fe/prepare USE_SOURCE_DIR=package/kernel/shortcut-fe/src
make V=s package/kernel/kmod-sched-cake/clean
make V=s package/kernel/kmod-sched-cake/prepare USE_SOURCE_DIR=package/kernel/kmod-sched-cake/src

Afterwards continue building again and it should finish successfully.

Btw, you can track all my changes with git.

Many thanks K3NNY, i will do it right now and feedback the results.

After running the script ./bb_openwrt.sh and make menuconfig, under kernel-->network support--> , there is no appearing of kmod-fast-classifier and shortcut-fe.

Is it normal and should i go on the make V=s compiling?

by the way, i used the original bb1407 and haven't done any upgrades of linux 3.10.49

@avbohemen I have exactly the same problem with Strongswan IPsec site-to-site connections. I resolved that by disable conntracking for my local networks (connected through IPsec connection). Fast-classifier is getting connection to offload from conntrack table, this breaks connections in IPsec tunnel.
Example of excluding connections from adding do conntrack table:
iptables -t raw -A PREROUTING -m iprange --src-range 192.168.0.2-192.168.1.254 --dst-range 192.168.0.2-192.168.1.254 -j CT --notrack

I described this in details in blogpost https://taczanowski.net/strongswan-ipsec-on-lede-openwrt-with-fast-classifier-and-shortcut-fe-modules/

@gwlim Thanks for you awesome work! :slight_smile:

You essentially gave up control of network packets flow of your router, which is not advisable.

I encountered similar issue with OpenVPN for my Broadcom routers running DD-WRT with QCA SFE. It doesn’t route packets that are policy routed. So I patched the fast-classifier connection manager to make it work.

The QCA SFE fast-classifier have problem looking up the destination interface properly when the routing table use is not the default table. So I hacked it to use the route table that the netfilter stack already found and used. Seems to have solved my problem. This has the benefit of also accelerating packets going thru the VPN tunnel, as it doesn’t have to go thru the netfilter again.

I made the same patch for LEDE/OpenWRT. If you’re interested, see if the patch solves your problem. You cab get my patch here:

HTH.

@quarky I'm testing your sfe-code, while compiling I get this error:

make[3]: Entering directory '/home/bouwew/escalade/LEDE/package/kernel/shortcut-fe'
rm -f /home/bouwew/escalade/LEDE/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/shortcut-fe/.built
touch /home/bouwew/escalade/LEDE/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/shortcut-fe/.built_check
cat /dev/null > /home/bouwew/escalade/LEDE/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pkginfo/shortcut-fe.symvers; for subdir in .; do cat /home/bouwew/escalade/LEDE/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pkginfo/*.symvers 2>/dev/null > /home/bouwew/escalade/LEDE/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/shortcut-fe/$subdir/Module.symvers; done
make -C "/home/bouwew/escalade/LEDE/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/linux-4.9.77" ARCH="arm" CROSS_COMPILE="arm-openwrt-linux-muslgnueabi-" SUBDIRS="/home/bouwew/escalade/LEDE/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/shortcut-fe" EXTRA_CFLAGS="" modules
make[4]: Entering directory '/home/bouwew/escalade/LEDE/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/linux-4.9.77'
CC [M] /home/bouwew/escalade/LEDE/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/shortcut-fe/sfe_ipv4.o
/home/bouwew/escalade/LEDE/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/shortcut-fe/sfe_ipv4.c: In function 'sfe_ipv4_recv_udp':
/home/bouwew/escalade/LEDE/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/shortcut-fe/sfe_ipv4.c:1366:5: error: 'struct sk_buff' has no member named 'fast_forwarded'
skb->fast_forwarded = 1;
^~
/home/bouwew/escalade/LEDE/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/shortcut-fe/sfe_ipv4.c: In function 'sfe_ipv4_recv_tcp':
/home/bouwew/escalade/LEDE/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/shortcut-fe/sfe_ipv4.c:1909:5: error: 'struct sk_buff' has no member named 'fast_forwarded'
skb->fast_forwarded = 1;
^~
scripts/Makefile.build:293: recipe for target '/home/bouwew/escalade/LEDE/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/shortcut-fe/sfe_ipv4.o' failed
make[5]: *** [/home/bouwew/escalade/LEDE/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/shortcut-fe/sfe_ipv4.o] Error 1
Makefile:1495: recipe for target 'module/home/bouwew/escalade/LEDE/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/shortcut-fe' failed

Am I doing something wrong? Can you please provide help?

For your info, I'm trying to build this on LEDE Master, target Netgear R7800.

@quarky Thanks for your response :slight_smile:
I will look on your patch :slight_smile:

I don't see many disadvantages of disabling conntracking for connections between my local networks. Probably this connections can't be shaping by SQM - this is disadvantage. But it is still managed by iptables, I can block traffic etc. In generally I need conntrack only for outbound connections from my local network to the internet :slight_smile:

In context of ofloading connections going through IPsec tunnel by fast-classifier, I don't see advantages of this, becouse this packets (all of them) must be processed by IPsec stack and it is slow regardless of using fast-classifier.

Another difficult thing is that strongswan does not using interfaces, only xfrm policies and route table 220. Traffic to remote network behind tunnel is routed through WAN interface o router, for example:

root@LEDE:~# ip route show table 220
192.168.1.0/24 via WAN_IP dev eth0.2  proto static  src 192.168.0.1

eth0.2 is the WAN interface, 192.168.1.0/24 is the network behind IPsec tunnel.

Of course, method with excluding connections from conntrack is a hack for this problem. I also thinking that the better why is to handle such situations in fast-classfier module.

Regards

You likely only copied the shortcut-fe folder without the kernel patches. You need the kernel patched to support shortcut-fe. The patches the ones provided by the OP, which I just took and applied to the lede-17.01 branch.

That’s explains why you had problem when SFE kicks in. Do post back if my patch solves your problem as well.

@quarky Ah, yes, I understand what's wrong. You have only included the patches for kernel 4.4, and master is on kernel 4.9.

@dissent1 In case you haven't noticed this, please find the interesting modification to SFE by @quarky, a few posts up.