Qualcomm Fast Path For LEDE

I assume you are already comfortable with compiling your own OpenWRT firmware images? If not, I would suggest that you get yourself familiar with the process of firmware image compilation. Once you're familiar build from source and working for your router, it will be quite easy to incorporate the commits I've posted earlier into your builds.

Otherwise, it wouldn't make sense for you to try, as you may brick your router.

I compile and make changes to the builds via menuconfig, but I haven't added a commit yet.

Oh, in that case, you would need to be familiar with the way the OpenWRT build processes work.

You just need to add in the files listed in my commits in the location shown and add the fast-classifier package in 'make menuconfig' and build away.

Hey,

Thanks for your reply. I also compiled successfully some images for my devices via make menuconfig, but I don't understand how to add your lines in that menu. Could you please show an example and do you think it's possible to compile stable versions to be able to use standard ipk for later installation needs. It's unfortunately always a pain in the ass with snapshots

It’s kind of hard to teach you how to apply patches. It’s best for you to learn it to be honest.

Also, I don’t really do community builds, so apologies.

I managed to compile and I'm running the firmware but despite listing the kmod-fast-classifier in the installed modules, the button to activate the SFE does not appear on the firewall. do you know what it can be?

Hi @jurandy007 , it's great that you managed to compile it. There's no GUI to enable/disable SFE in the firewall UI.

If you installed Luci for your build, do you see the 'shortcut-fe' option in System -> Startup? As there's an startup script installed if the build is correct, you should see the option to enable/disable shortcut-fe.

You can also check if '/sys/fast-classifier' directory is available when you SSH into your router. If it is there, SFE is running with the fast-classifier connection manager.

You can also issue the command 'lsmod | grep fast'. You should see something like the below:

fast_classifier        90112  0
nf_conntrack           90112  8 fast_classifier,xt_state,xt_nat,xt_conntrack,xt_REDIRECT,xt_MASQUERADE,nf_nat,nf_flow_table
shortcut_fe            98304  1 fast_classifier
shortcut_fe_ipv6       98304  1 fast_classifier
1 Like

First of all thank you very much for your help.
My output from 'lsmod | grep fast 'It's the same as yours and it's also in System > Initialize. So it worked, except for one thing. In the SFE of "gwlim" when it is activated there in the firewall> SFE my 250MB internet that is working at 100MB in openwrt goes back to working 250MB, but not in this construction I did now, it's still at 100MB.

Unless the code from @gwlim is optimised and different from the code from QCA, it should provide similar performance. It's strange. Do you mind telling me the device you're running it in?

Also, for the fast-classifier connection manager, I like the set the following to make acceleration of connections starts earlier:

echo 4 > /sys/fast_classifier/offload_at_pkts
echo 1 > /sys/fast_classifier/skip_to_bridge_ingress

You may want to add the above into your router's startup script if you still are running the build with SFE.

Edit: Also, please do not run both the standard Linux flow-offloading and shortcut-fe at the same time, or you may see funny results. Only use one or the other, not both together.

My router is Archer C7 V5 (Arc MIPS 74Kc).

I have great news, SFE finally worked as it should. The problem in the end was not him, but the internet modem, I changed port 1 to 2 and the 250MB normally worked with SFE enabled both wired and wifi.

I didn't remember, but even when I was in @gwlim build I had this problem with the modem before him (I didn't care about this problem anymore, because at the time I managed to get around it just by restarting the modem, but I think with the new router firmware I had problems with him). I can reset again or exit this port.

@quarky Thank you very much for your patience, help and prior knowledge. I would like to ask you one more thing.
is the SFE version you have the latest?

Analyzing @gwlim's patch code I saw that it pulls the SFE from this link, but it contains several:
https://source.codeaurora.org/quic/qsdk/oss/system/feeds/shortcut-fe/

it had recent updates and I don't know which of these versions works for my model (the one he used was endive_mips but it's very leaky and it was for the LEDE 17).

Sorry for the big text, thanks

It's great that you got it working now!

Edit: It just occurred to me you may have a network cable problem, limiting your connection to 100mbps (i.e. Fast Ethernet) speed?

If you used the build package extracted from my Github repo, it will clone from the Git repository shown above. It clones the QSDK 11.2-r1 sources. But from what I remember, QCA did not update shortcut-fe for quite a while, so I think it should be the latest sources. I applied some patches to the code to the fast-classifier connection manager to work around policy based routing issue with the original code. That's about it.

It wasn't the network cable, it was the modem setup before the router.

another thing, I tried to download the latest version of the SFE from the source I mentioned above and when I put it back in the folder it didn't show up in the make menu.

Looking at the last SFE folder I saw that it was different from yours. The makefile had almost no command lines and the folder had .c and .h files

print

There's no need to get the latest from CodeAurora's repository. I just checked. The one that I'm using is the latest. The shortcut-fe codes has not been changes since 2019. Just minor patches to get it to work for later kernels.

If you're using my patches, we no longer extract source codes from the CodeAurora repo. We download it during build/compile. We just have the Makefiles created in our repo. This is inline with the majority of OpenWrt's components.

So in short, if you are using the patches from my repo., you are already running the latest shortcut-fe codes.

So continue enjoy your router and don't worry about not running the latest codes.

1 Like

First of all thanks for all the previous help.

I recently tried to recompile a new image based on the latest openwrt and with its SFE but I got errors 1 and 2 on the compilation. when I disable the module SFE in the config it compiles normally. Did the new openwrt files become incompatible with SFE?

Most likely due to error patching the kernel source code. Unless you know how to fix the patches, I suggest you try not to go to the latest commits. I suppose you’re trying master build? Without the error logs, it’s hard to assess what’s wrong.

Hello, need a little help.

I had a hootoo/strong 1200 device running openwrt.

I tried to create a patch for my device, edited the dts files, added the compatiblity for network etc.

After building i thought of flashing the initramfs image in order to "test" the firmware before running sysupgrade, thinking initramfs doesn't "write" anything on the device but i was wrong.

Unfortunately flashing the initramfs kernel on the device bricked it and i cannot connect to it via putty.

Does flashing initramfs image via openwrt can brick the device?
Any tips on recovering the device? do I need to connect to serial port?

Thanks,
St96

Please don't double-post, MT7621 - 21.02/Master feedback firmware image test - IPV6 offload and disabled Flow Control - #146 by st96

my apologies. Thanks again for you reply in the other thread.

Could we please add support for Deco M4R V1 ? It's pretty much an Archer V2 but with fewer ports.

I decided to try to do it myself but so far, no luck.
I cloned the repo from https://github.com/quarkysg/openwrt/tree/openwrt-21.02-ipq806x-nss-qsdk11.
Fixed some files that were calling source.codeaurora.org just like it was done on this commit https://github.com/coolsnowwolf/lede/pull/11055/files
Then I pulled the default config from: wget https://downloads.openwrt.org/releases/21.02.1/targets/ath79/generic/config.buildinfo -O .config
Copied the commit that adds support to my Deco M4R from master - https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=063e9047cc8b247ea4b04ee3248b99f3212a42f8
Ran:

./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig (selected my device, just like any other openwrt build)
make defconfig
make download
make -j1 V=sc

But the build fails with:

make[4]: Entering directory '/home/carlos/openwrt2/build_dir/target-mips_24kc_musl/linux-ath79_generic/linux-5.4.225'
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (                \
echo >&2;                                                       \
echo >&2 "  ERROR: Kernel configuration is invalid.";           \
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";      \
echo >&2 ;                                                      \
/bin/false)
make -f ./scripts/Makefile.build obj=/home/carlos/openwrt2/build_dir/target-mips_24kc_musl/linux-ath79_generic/qca-mcs-31f5cd4b \
single-build= \
need-builtin=1 need-modorder=1
  mips-openwrt-linux-musl-gcc -Wp,-MD,/home/carlos/openwrt2/build_dir/target-mips_24kc_musl/linux-ath79_generic/qca-mcs-31f5cd4b/.mc_netlink.o.d -nostdinc -isystem /home/carlos/openwrt2/staging_dir/toolchain-mips_24kc_gcc-8.4.0_musl/lib/gcc/mips-openwrt-linux-musl/8.4.0/include -I./arch/mips/include -I./arch/mips/include/generated  -I./include -I./arch/mips/include/uapi -I./arch/mips/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -DVMLINUX_LOAD_ADDRESS=0xffffffff80060000 -DLINKER_LOAD_ADDRESS=0x80060000 -DDATAOFFSET=0 -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 -mno-check-zero-division -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -mno-branch-likely -msoft-float -DGAS_HAS_SET_HARDFLOAT -Wa,-msoft-float -ffreestanding -fno-stack-check -march=mips32r2 -mtune=34kc -Wa,--trap -DTOOLCHAIN_SUPPORTS_VIRT -DTOOLCHAIN_SUPPORTS_XPA -DTOOLCHAIN_SUPPORTS_CRC -DTOOLCHAIN_SUPPORTS_DSP -DTOOLCHAIN_SUPPORTS_GINV -I./arch/mips/include/asm/mach-ath79 -I./arch/mips/include/asm/mach-generic -fno-asynchronous-unwind-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -O2 --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fstack-protector -Wimplicit-fallthrough -Wno-unused-but-set-variable -Wno-unused-const-variable -fomit-frame-pointer -fno-var-tracking-assignments -g -femit-struct-debug-baseonly -fno-var-tracking -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -fmacro-prefix-map=./= -Wno-packed-not-aligned -ffile-prefix-map=/home/carlos/openwrt2/build_dir/target-mips_24kc_musl=target-mips_24kc_musl -fno-caller-saves -I/home/carlos/openwrt2/build_dir/target-mips_24kc_musl/linux-ath79_generic/linux-5.4.225 -I/lib/modules/5.15.133.1-microsoft-standard-WSL2/build/include/linux -I/lib/modules/5.15.133.1-microsoft-standard-WSL2/build/include/asm -I/lib/modules/5.15.133.1-microsoft-standard-WSL2/build/net/bridge -I/home/carlos/openwrt2/build_dir/target-mips_24kc_musl/linux-ath79_generic/linux-5.4.225/include/linux -I/home/carlos/openwrt2/build_dir/target-mips_24kc_musl/linux-ath79_generic/linux-5.4.225/include/asm -I/home/carlos/openwrt2/build_dir/target-mips_24kc_musl/linux-ath79_generic/linux-5.4.225/net/bridge -DMC_SUPPORT_MLD -Werror -Wall -g  -DMODULE -mno-long-calls  -DKBUILD_BASENAME='"mc_netlink"' -DKBUILD_MODNAME='"qca_mcs"' -c -o /home/carlos/openwrt2/build_dir/target-mips_24kc_musl/linux-ath79_generic/qca-mcs-31f5cd4b/mc_netlink.o /home/carlos/openwrt2/build_dir/target-mips_24kc_musl/linux-ath79_generic/qca-mcs-31f5cd4b/mc_netlink.c
In file included from /home/carlos/openwrt2/build_dir/target-mips_24kc_musl/linux-ath79_generic/qca-mcs-31f5cd4b/mc_netlink.c:21:
/home/carlos/openwrt2/build_dir/target-mips_24kc_musl/linux-ath79_generic/qca-mcs-31f5cd4b/mc_osdep.h: In function 'os_br_pass_frame_up':
/home/carlos/openwrt2/build_dir/target-mips_24kc_musl/linux-ath79_generic/qca-mcs-31f5cd4b/mc_osdep.h:27:9: error: implicit declaration of function 'br_pass_frame_up'; did you mean 'os_br_pass_frame_up'? [-Werror=implicit-function-declaration]
  return br_pass_frame_up(skb);
         ^~~~~~~~~~~~~~~~
         os_br_pass_frame_up
cc1: all warnings being treated as errors
make[5]: *** [scripts/Makefile.build:262: /home/carlos/openwrt2/build_dir/target-mips_24kc_musl/linux-ath79_generic/qca-mcs-31f5cd4b/mc_netlink.o] Error 1
make[4]: *** [Makefile:1739: /home/carlos/openwrt2/build_dir/target-mips_24kc_musl/linux-ath79_generic/qca-mcs-31f5cd4b] Error 2
make[4]: Leaving directory '/home/carlos/openwrt2/build_dir/target-mips_24kc_musl/linux-ath79_generic/linux-5.4.225'
make[3]: *** [Makefile:58: /home/carlos/openwrt2/build_dir/target-mips_24kc_musl/linux-ath79_generic/qca-mcs-31f5cd4b/.built] Error 2
make[3]: Leaving directory '/home/carlos/openwrt2/package/qca/qca-mcs'
time: package/qca/qca-mcs/compile#0.60#0.08#0.62
    ERROR: package/qca/qca-mcs failed to build.
make[2]: *** [package/Makefile:116: package/qca/qca-mcs/compile] Error 1
make[2]: Leaving directory '/home/carlos/openwrt2'
make[1]: *** [package/Makefile:110: /home/carlos/openwrt2/staging_dir/target-mips_24kc_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/carlos/openwrt2'
make: *** [/home/carlos/openwrt2/include/toplevel.mk:230: world] Error 2

Can anyone help me please ?
Thank you