MT6000 custom build with LuCi and some optimization - kernel 6.6.x

Hi @pesa1234

I no longer use the packet steering script.

I now set these settings after wi-fi has been enabled.

echo 2 > /proc/irq/120/smp_affinity
echo 8 > /proc/irq/121/smp_affinity
echo 4 > /proc/irq/133/smp_affinity

taskset -p -c 0,2,3 `pgrep mtk_eth-5`
taskset -p -c 0,1,2 `pgrep mtk_eth-6`
taskset -p -c 0,1,3 `pgrep mt76-tx`
for q in /sys/class/net/eth0/queues/rx-*/rps_cpus; do echo 0 > $q; done
for q in /sys/class/net/eth1/queues/rx-*/rps_cpus; do echo 0 > $q; done
for q in /sys/class/net/phy?-ap?/queues/rx-*/rps_cpus; do echo 0 > $q; done
for q in /sys/class/net/eth0/queues/tx-*/xps_cpus; do echo 0 > $q; done
for q in /sys/class/net/eth1/queues/tx-*/xps_cpus; do echo 0 > $q; done

I've just discovered that napi/phy0-10 and napi/phy0-12 use the CPU when sending and receiving wi-fi, so I'm trying to see if there's a good setting for that.

4 Likes

@nxhack , any suggestions for those of us sharing USB storage?

echo 2 > /proc/irq/120/smp_affinity   # ethernet 
echo 8 > /proc/irq/121/smp_affinity   # ethernet
echo 4 > /proc/irq/133/smp_affinity   # WIFI all
echo 1 > /proc/irq/128/smp_affinity   # USB
2 Likes

When observing napi/phy0-10 and napi/phy0-12, an invalid configuration was found.
Unlike ethernet napi, it seems that the CPU is fixed for mt76-tx.
The following is the configuration after the correction. The configuration of phy0-10 and phy0-12 is a temporary setting.

echo 2 > /proc/irq/120/smp_affinity
echo 8 > /proc/irq/121/smp_affinity
echo 4 > /proc/irq/133/smp_affinity
echo 1 > /proc/irq/128/smp_affinity

taskset -p -c 0,2,3 `pgrep mtk_eth-5`
taskset -p -c 0,1,2 `pgrep mtk_eth-6`
taskset -p -c 1 `pgrep mt76-tx`
taskset -p -c 1 `pgrep phy0-10`
taskset -p -c 1 `pgrep phy0-12`

for q in /sys/class/net/eth0/queues/rx-*/rps_cpus; do echo 0 > $q; done
for q in /sys/class/net/eth1/queues/rx-*/rps_cpus; do echo 0 > $q; done
for q in /sys/class/net/phy?-ap?/queues/rx-*/rps_cpus; do echo 0 > $q; done
for q in /sys/class/net/eth0/queues/tx-*/xps_cpus; do echo 0 > $q; done
for q in /sys/class/net/eth1/queues/tx-*/xps_cpus; do echo 0 > $q; done

@pesa1234
Would you make a new PR for the new ksmbd-tools version.

1 Like

It's so detailed that I can't tell the difference (lol)
I think I'll settle on this setting.

The kernel thread of napi/phy0-? is called from the mt76 driver, so I think it's fine to use the common settings for Wi-Fi.

taskset -p -c 1 `pgrep mt76-tx`
for p in `pgrep napi/phy0`; do taskset -p -c 0,1,3 $p; done
1 Like

thanks a lot for sharing. I have paste your script tuning to smp_affinity script.

Thanks

1 Like

Done, thanks!

4 Likes

New version available:

Changelog:

-mt76:
-fix mt7915_coredump_register
-fix regmapsize
-exclude tx backoff time from airtime
-smp_affinity:
-if packet steering script is enabled leave that settings to packet steering script
- imported tuning from @nxhack
-kernel update 6.6.63
-busybox update to 1.37.0

14 Likes

updated but now lost wifi connection, not first time it happens, needed to reset it last time, dunno why this happens.

I just use the sysupgrade.bin, correct? I am guessing yes, I can't imagine why not but just wanted to make sure with the multiple different versions in the directory on GH.
I am still on the last opkg build if it makes any difference.

Restart WiFi and check the syslog for error messages.

If that doesn’t give you a clue, you can rename the wireless config file and reboot. This will recreate it with default values. Next compare both configs, especially things like "device".

Tried it out but it hasnt the wireguard plugin. so im gonna stay with 4.3.6

You can install...

1 Like

Thanks. With 4.3.6 i couldnt update software list. So i thought it would be the same with this new version.

I got everything to run, but ksmbd only finds one drive only of my 2 HDD Drives. With 4.3.6 i found both drives.

Disconnect the hard drive not mounted

blkid

write me the output

connect
blkid

give me the output

Thanks

root@OpenWrt:~# blkid
/dev/mmcblk0p7: BLOCK_SIZE="262144" TYPE="squashfs" PARTLABEL="rootfs" PARTUUID="233f2c1c-20a5-11ee-9abf-000c29dba895"
/dev/loop0: LABEL="rootfs_data" UUID="d2508a4e-ef0e-4300-8e15-898f06cc23a1" BLOCK_SIZE="4096" TYPE="f2fs"
/dev/sda1: LABEL="18TB WD Elements 4K Filme" BLOCK_SIZE="512" UUID="DC466BAE466B87DA" TYPE="ntfs" PARTLABEL="Elements" PARTUUID="5986b3c7-05a2-4f2d-83a2-68421f47527e"
/dev/mmcblk0p5: PARTLABEL="log" PARTUUID="233f2c1a-20a5-11ee-9abf-000c29dba895"
/dev/mmcblk0p3: PARTLABEL="fip" PARTUUID="233f2c18-20a5-11ee-9abf-000c29dba895"
/dev/mmcblk0p1: PARTLABEL="u-boot-env" PARTUUID="233f2c16-20a5-11ee-9abf-000c29dba895"
/dev/mmcblk0p6: PARTLABEL="kernel" PARTUUID="233f2c1b-20a5-11ee-9abf-000c29dba895"
/dev/mmcblk0p4: PARTLABEL="cfg" PARTUUID="233f2c19-20a5-11ee-9abf-000c29dba895"
/dev/mmcblk0p2: PARTLABEL="factory" PARTUUID="233f2c17-20a5-11ee-9abf-000c29dba895"

This is the one he finds. He doesnt find the other one so the text doesnt change when unplug and plugin after

Edit: Both HDDs are plugged in an active usb hub. But it worked for official glinet firmwares, their open source op24 firmwares and your 4.3.6 firmware. With some other firmwares of your build it didnt work either, only 4.3.6 but i dont know why.

connect and try lsusb

root@OpenWrt:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux 6.6.63 xhci-hcd xHCI Host Controller
Bus 001 Device 002: ID 0bda:5411 Generic 4-Port USB 2.0 Hub
Bus 001 Device 003: ID 0bda:5411 Generic 4-Port USB 2.0 Hub
Bus 002 Device 001: ID 1d6b:0003 Linux 6.6.63 xhci-hcd xHCI Host Controller
Bus 002 Device 002: ID 0bda:0411 Generic 4-Port USB 3.0 Hub
Bus 002 Device 003: ID 0bc2:331a Seagate Expansion Desk
Bus 002 Device 004: ID 1058:25a3 Western Digital Elements 25A3
Bus 002 Device 005: ID 0bda:0411 Generic 4-Port USB 3.0 Hub

With lsusb it finds my seagate. but it isnt mounted.

Got it to work. Chatgpt said i should try to install following packages:

kmod-usb-storage
kmod-usb-storage-uas
block-mount
kmod-fs-ext4
kmod-fs-ntfs
ntfs-3g kmod-fs-vfat

After that it works now. Thats the Problem for me, your 4.3.6 Firmware has all necessary packages preinstalled and its easier for me as openwrt noob :smile:

However it works now! Thank you and sorry for that!

can you give the syslog after disconnect and connect?

Or, do you know the filesystem of that hard drive?

Thanks