Netgear R7800 exploration (IPQ8065, QCA9984)

But what do I actually get with setting up those affinity options manually?
Is it even recommended? I own TP-Link C2600.

By default all IRQs (for eth0, eth1 and both ath10k radios) have been assigned to core0 of the CPU.

See cat /proc/interrupts in a live router.

You can manually assign them more evenly between core0 and core1 by simply writing suitable values into /proc/irq/X/smp_affinity (where X is the IRQ to be adjusted). That will help CPU load in peaks.
E.g. eth1 and eth0 to different cores, and the same with radio0 and radio1

You might read the discussion in this thread in January 2017. The commands etc. are explained there. Starting from here:

Btw I've recently found that L2 cache is undersupplied in current setup. It's being supplied with 1.05V while according to gpl and qsdk voltage should be 1.10V nominal and 1.15 when when at max freq.
I'm almost done with the patch with correct l2 voltage and frequency scaling.

Is that set in LEDE or upstream?

I’m running your previous patch, and it’s running rock stable though.

Here's the proper l2 scaling patchset (consists of 3 consequential patches)
https://github.com/dissent1/r7800/commit/d8d668f02fa6e094029d93218191536d754c5f13
https://github.com/dissent1/r7800/commit/5dece07f2c08451dc8f065b588385a0a36b0664d
https://github.com/dissent1/r7800/commit/c2e39e813969935b2de5596262f898c7e3d4a995

To check l2 cache scaling you can
check frequency: cat /sys/kernel/debug/clk/krait_l2_pri_mux/clk_rate
check voltage (s1a regulator): cat /sys/kernel/debug/regulator/regulator_summary

@hnyman @blogic

edit: updated the 3rd commit. The patch was malformed and didn't apply cleanly because of me manually rebasing from k4.14 that I'm working on.

I am going to give these patches a shot. Is there a way to generate a .patch per file that is changed here rather than per commit? Thanks.

Not quite sure what do you mean, but you can download any Github commit by just adding ".patch" to the end, and after downloading patch you can apply that with "patch -p 1 -i XXX".

E.g. that last commit "ipq806x: support L2 cache scaling"

wget https://github.com/dissent1/r7800/commit/a5624ef53e9aea7a3e86748fa3e967735436d984.patch
patch -p 1 -i a5624ef53e9aea7a3e86748fa3e967735436d984.patch

or first test if it applies cleanly with

patch --dry-run -p 1 -i a5624ef53e9aea7a3e86748fa3e967735436d984.patch
1 Like

updated the 3rd commit. The patch was malformed (missed space in the beginning of an entry) and didn’t apply cleanly because of me manually rebasing from k4.14 that I’m working on.

1 Like

I have these patches all compiled in and everything seems to be running great.

root@x:~# cat /sys/kernel/debug/clk/krait_l2_pri_mux/clk_rate
384000000
root@x:~# cat /sys/kernel/debug/regulator/regulator_summary
 regulator                      use open bypass voltage current     min     max
-------------------------------------------------------------------------------
 regulator-dummy                  0    6      0     0mV     0mA     0mV     0mV 
    1b700000.pci                                                    0mV     0mV
    1b700000.pci                                                    0mV     0mV
    1b700000.pci                                                    0mV     0mV
    1b500000.pci                                                    0mV     0mV
    1b500000.pci                                                    0mV     0mV
    1b500000.pci                                                    0mV     0mV
 SDCC Power                       0    0      0  3300mV     0mA  3300mV  3300mV 
 s1a                              0    2      0  1100mV     0mA  1050mV  1150mV 
    cpu1                                                         1100mV  1150mV
    cpu0                                                         1100mV  1150mV
 s1b                              0    0      0  1050mV     0mA  1050mV  1150mV 
 s2a                              0    1      0   875mV     0mA   775mV  1275mV 
    cpu0                                                          875mV   918mV
 s2b                              0    1      0   875mV     0mA   775mV  1275mV 
    cpu1                                                          875mV   918mV
root@x:~#

Now I wonder if there's practical difference apart from running the cache at proper hw state.
QoS? Throughput?

@dissent1 I will apply these 3 new patches to your sta-110 branch. With some tweaking I will get this to work.
I have one question though: do I need to remove the 3 rpm-clk related patches? Or do these not interfere with the new patches?

I'm glad to see that the progress of the ipq. When can we enjoy them in Lede / openwrt or some charitable soul that includes these improvements in their compilations?

I'm a bit confused here... I'm assuming you drop this set_cpu_affinity file into /etc/init.d/, correct? I did that, chmodded it to allow execution, and it is now visible from the LUCI gui web interface as "set_cpu_affinity" with options to Enable, Start, Restart, and Stop—as you would expect.

However, when issuing the command

cat /proc/interrupts/

CPU core 1 is still not balancing out the IRQs as much as I would like. Additionally, checking the system log reveals the following error message:

daemon.err uhttpd[1100]: /etc/rc.common: line 357: board_name: not found

Is this normal, or is something not right?

Oh, and to make matters worse, I checked the source code for "rc.common", and as it turns out, line 357 doesn't even exist! :face_with_raised_eyebrow:

Those 3 rpm test commits should be removed - useless.
I suggest you to go for my 414-9 branch and use k4.14.

Gotta cleanup my GitHub:/

Thx for the advice, building k4.14 now!

About your Github, may I suggest that you store your patches separately, per target and per subject?
E.g. I would not have known about DSA if that hadn't come up recently. Maybe there are more of these little gems in your Github? :slight_smile:

Update: managed to fix the error by adding 1 line into the IPSET Makefile:

MAKE_FLAGS += \
	FPIC="$(FPIC)" \

Build failed with this error:

make[6]: Entering directory '/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/ipset-6.34/lib'
  CCLD     libipset.la
/home/bouwew/lede414/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.2.0_musl_eabi/lib/gcc/arm-openwrt-linux-muslgnueabi/7.2.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: .libs/errcode.o: relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
.libs/errcode.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status

Any suggestion? @jow

@dissent1 wouldn't you be interested to become the maintainer of the IPQ806 code for Lede?
your code is well ahead of what Lede has to offer and it seems NBD is to busy to keep up.

I wouldn't mind having a more active maintainer of the code :slight_smile:

TARGET_CFLAGS += $(FPIC)

I continued my 4.14-build. A new error pops up:

make[3]: Entering directory '/home/bouwew/lede414/feeds/packages/kernel/exfat-nofuse'
rm -f /home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/.built
touch /home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/.built_check
cat /dev/null > /home/bouwew/lede414/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pkginfo/exfat-nofuse.symvers; for subdir in .; do cat /home/bouwew/lede414/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pkginfo/*.symvers 2>/dev/null > /home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/$subdir/Module.symvers; done
make -C "/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/linux-4.14.11" ARCH="arm" CROSS_COMPILE="arm-openwrt-linux-muslgnueabi-" M="/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3" CONFIG_EXFAT_FS=m modules
make[4]: Entering directory '/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/linux-4.14.11'
  CC [M]  /home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.o
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c: In function 'exfat_create':
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c:733:7: error: 'CURRENT_TIME_SEC' undeclared (first use in this function); did you mean '_STRUCT_TIMESPEC'?
  ts = CURRENT_TIME_SEC;
       ^~~~~~~~~~~~~~~~
       _STRUCT_TIMESPEC
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c:733:7: note: each undeclared identifier is reported only once for each function it appears in
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c: In function 'exfat_unlink':
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c:889:7: error: 'CURRENT_TIME_SEC' undeclared (first use in this function); did you mean '_STRUCT_TIMESPEC'?
  ts = CURRENT_TIME_SEC;
       ^~~~~~~~~~~~~~~~
       _STRUCT_TIMESPEC
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c: In function 'exfat_symlink':
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c:934:7: error: 'CURRENT_TIME_SEC' undeclared (first use in this function); did you mean '_STRUCT_TIMESPEC'?
  ts = CURRENT_TIME_SEC;
       ^~~~~~~~~~~~~~~~
       _STRUCT_TIMESPEC
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c: In function 'exfat_mkdir':
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c:1012:7: error: 'CURRENT_TIME_SEC' undeclared (first use in this function); did you mean '_STRUCT_TIMESPEC'?
  ts = CURRENT_TIME_SEC;
       ^~~~~~~~~~~~~~~~
       _STRUCT_TIMESPEC
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c: In function 'exfat_rmdir':
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c:1067:7: error: 'CURRENT_TIME_SEC' undeclared (first use in this function); did you mean '_STRUCT_TIMESPEC'?
  ts = CURRENT_TIME_SEC;
       ^~~~~~~~~~~~~~~~
       _STRUCT_TIMESPEC
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c: In function 'exfat_rename':
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c:1131:7: error: 'CURRENT_TIME_SEC' undeclared (first use in this function); did you mean '_STRUCT_TIMESPEC'?
  ts = CURRENT_TIME_SEC;
       ^~~~~~~~~~~~~~~~
       _STRUCT_TIMESPEC
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c: In function 'exfat_cont_expand':
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c:1205:36: error: 'CURRENT_TIME_SEC' undeclared (first use in this function); did you mean '_STRUCT_TIMESPEC'?
  inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC;
                                    ^~~~~~~~~~~~~~~~
                                    _STRUCT_TIMESPEC
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c: At top level:
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c:1388:19: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  .getattr       = exfat_getattr,
                   ^~~~~~~~~~~~~
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c:1388:19: note: (near initialization for 'exfat_dir_inode_operations.getattr')
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c:1422:17: error: 'generic_readlink' undeclared here (not in a function); did you mean 'generic_read_dir'?
  .readlink    = generic_readlink,
                 ^~~~~~~~~~~~~~~~
                 generic_read_dir
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c: In function '_exfat_truncate':
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c:1490:36: error: 'CURRENT_TIME_SEC' undeclared (first use in this function); did you mean '_STRUCT_TIMESPEC'?
  inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC;
                                    ^~~~~~~~~~~~~~~~
                                    _STRUCT_TIMESPEC
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c: At top level:
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c:1514:17: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  .getattr     = exfat_getattr,
                 ^~~~~~~~~~~~~
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c:1514:17: note: (near initialization for 'exfat_file_inode_operations.getattr')
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c: In function 'exfat_write_end':
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c:1686:37: error: 'CURRENT_TIME_SEC' undeclared (first use in this function); did you mean '_STRUCT_TIMESPEC'?
   inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC;
                                     ^~~~~~~~~~~~~~~~
                                     _STRUCT_TIMESPEC
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c: In function 'exfat_read_root':
/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.c:2416:7: error: 'CURRENT_TIME_SEC' undeclared (first use in this function); did you mean '_STRUCT_TIMESPEC'?
  ts = CURRENT_TIME_SEC;
       ^~~~~~~~~~~~~~~~
       _STRUCT_TIMESPEC
cc1: some warnings being treated as errors
scripts/Makefile.build:314: recipe for target '/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.o' failed
make[5]: *** [/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/exfat_super.o] Error 1
Makefile:1505: recipe for target '_module_/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3' failed
make[4]: *** [_module_/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3] Error 2
make[4]: Leaving directory '/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/linux-4.14.11'
Makefile:52: recipe for target '/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/.built' failed
make[3]: *** [/home/bouwew/lede414/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x/exfat-nofuse-2017-01-03-8d291f525ce6d88fe0d8b11b86fd5c2e900401d3/.built] Error 2
make[3]: Leaving directory '/home/bouwew/lede414/feeds/packages/kernel/exfat-nofuse'
package/Makefile:109: recipe for target 'package/feeds/packages/exfat-nofuse/compile' failed
make[2]: *** [package/feeds/packages/exfat-nofuse/compile] Error 2

@hnyman can I disable the package kmod-fs-exfat? Why do you have it in your ...main.patch?