Adding OpenWrt support for QNAP QHora-301W

i politely disagree ... on my end with 160mhz channel 100 region US it performs great at rates of 1584mbits. However, the aquantia is still a mistery to me ...


My mesh consisting of three AX3600 and qnap 301W. Has been running without hitches since july ... Updating the fw almost weekly to the latest robimarko prebuilt image.

2 Likes

Perhaps I'll have to give t another shot then. Will report back later

Made a fresh build from @robimarko’s repo and I have almost everything working now. Only issue I have is when I have an 802.11s mesh client join, dhcp completely breaks across the whole network. That’s new.

I haven’t tested 10g nics yet outside of the failure to auto negotiate at 1g issue.

Actually it looks like it breaks all wireless connectivity on that band except for the mesh node.

Successful installed without UART.

Do on your own risk! If something went wrong you might need UART to recover.

Download openwrt-ipq807x-generic-qnap_301w-squashfs-sysupgrade.bin and AQR_ethphyfw.mbn

Extract kernel and root from openwrt-ipq807x-generic-qnap_301w-squashfs-sysupgrade.bin

With booted QuRouter OS hold WPS button until second beep to enable ssh, login with:

ssh admin@192.168.100.1 -p 22200

Set boot partition to "1"

sudo fw_setenv current_entry 1
sudo reboot

Check boot partition (if it's not "1" repeat previous steps):

sudo fw_printenv -n current_entry

Copy files to /tmp/

scp -P 22200 kernel admin@192.168.100.1:/tmp/
scp -P 22200 root admin@192.168.100.1:/tmp/

Flash firmware and set boot patition to "0":

sudo dd if=/tmp/kernel of=/dev/mmcblk0p1
sudo dd if=/tmp/root of=/dev/mmcblk0p4
sudo fw_setenv current_entry 0
sudo fw_setenv boot_0 good
sudo reboot

It should boot to openwrt, now install firmware for 10G phys.
Check if partition mtd10 and backup:

cat /proc/mtd|grep "0:ethphyfw"
dd if=/dev/mtd10 of=/tmp/ethphyfw.backup

Copy backup to pc and firmware to qnap:

scp root@192.168.1.1:/tmp/ethphyfw.backup ./
scp AQR_ethphyfw.mbn root@192.168.1.1:/tmp/

Install firmware:

mtd erase /dev/mtd10
mtd -n write /tmp/AQR_ethphyfw.mbn /dev/mtd10

Set bootcmd and check before reboot:

fw_setenv bootcmd "aq_load_fw 0; aq_load_fw 8; bootipq"
fw_printenv -n bootcmd
reboot

Settings don't stick, so I installed sysupgrade in openwrt.
Copy file:

scp openwrt-ipq807x-generic-qnap_301w-squashfs-sysupgrade.bin root@192.168.1.1:/tmp/

Sysupgrade:

sysupgrade -n /tmp/openwrt-ipq807x-generic-qnap_301w-squashfs-sysupgrade.bin

Thanks to robimarko, kirdes and all contributors!

Source:
https://github.com/robimarko/openwrt/commit/a0e0140b09f6924be4ca8de6019109c64433e60c
https://pfschina.org/wp/?p=9263

8 Likes

Thanks for this, it makes barrier to entry much lower.

3 Likes

I got a second device and successfully installed openwrt using the instructions provided by @MusikJunk.
However i ran into two problems on both, the linked fw and one that i built myself.

  1. how can i actually verify that nss works correctly?
    On the linked firmware i see at least some "nss-dp" in dmesg.
root@OpenWrt:~# dmesg | grep -i nss
[    4.166754] nss-dp 3a001000.dp1 eth0: Registered netdev eth0(qcom-id:1)
[    4.182865] nss-dp 3a001200.dp2 eth1: Registered netdev eth1(qcom-id:2)
[    4.199011] nss-dp 3a001400.dp3 eth2: Registered netdev eth2(qcom-id:3)
[    4.215108] nss-dp 3a001600.dp4 eth3: Registered netdev eth3(qcom-id:4)
[    4.238592] nss-dp 3a001800.dp5 eth4: Registered netdev eth4(qcom-id:5)
[    4.262227] nss-dp 3a007000.dp6 eth5: Registered netdev eth5(qcom-id:6)
[    4.278107] * NSS Data Plane driver
[   14.928378] nss-dp 3a001200.dp2 eth1: PHY Link up speed: 1000
[   20.153499] nss-dp 3a007000.dp6 eth5: PHY Link up speed: 10000
[  126.231221] nss-dp 3a007000.dp6 eth5: PHY Link is down
[  129.351556] nss-dp 3a007000.dp6 eth5: PHY Link up speed: 1000

Don't have that on my custom buld one, even though i loaded nss modules and firmwares.
(btw i'm also trying to get hardware accelerated crypto support for ipsec vpn, maybe i included conflicting modules?)

Either way, in neither build i was able to get more than 2,5GB/s performance on 10GBe WAN port, while having 100% CPU load on one core.

  1. Is it possible somehow to get WAN working at 1GB/s speed?
    I don't mind having some tool auto-run at boot, or switching from eth5 to a different ethernet port, but on this device i need to get WAN working at 1GB/s, which currently doesn't work by just connecting to eth5.
    10GBe gives me at least a connection (even though i suspect it's not properly offloaded)
1 Like

I don’t know the answer for 1 as I’m facing the same problem, but for 2 yes you can - if you’re using LuCI you can go to Network>Interfaces and go under the Devices tab and remove one of eth0-eth3 from all bridges. You can also add in eth5 if you’d like to use it on LAN.

Then go back to the interfaces tab and select that single eth0 or 1 or 2 or 3 port in WAN and WAN6 (if using IPv6).

Also, pleasant seeing you around here :slight_smile:

1 Like

Think you need nss-ecm

How can i get that?
It's supposed to be under Kernelmodules -> Network Support, but i can't find it there.
If i manually add an entry CONFIG_PACKAGE_kmod_qca-nss-ecm, then the module fails to compile.
Btw i'm using the ipq807x-5.15 branch of https://github.com/robimarko/openwrt.

I just noticed there is also a ipq807x-5.15-pr branch, which seems more recent and i'll try next.
Which is the currenty latest branch?

It wont work, ECM and the rest of offloading family are inherently broken and such a pain in the ass that I gave up on them

there is no plan to use it as Robi mentioned it... however there are a couple of repos on github that brought ecm and other qca packages to 5.15

https://github.com/coolsnowwolf/lede & https://github.com/bitthief/openwrt/commits/ipq807x-5.15-pr

note the above is not openwrt!!!

For my use case I haven't seen a noticeable improvement after building both repos

New territory for me -- does this mean we will never see true 10g on this device?

Never is a strong word, however there is still substantial performance left on the table by implementing some basic networking offloads like TSO, checksum offloading, VLAN etc as NSS-DP for EDMA v1 is really, really bad

2 Likes

Have you looked at the repo by bitthief that @rmandrad linked?
I assume those don't just work with your branch (if merged properly), right?
Or are there other problems like often breaking code changes to the main kernel, or incomplete offloading implementation, or is it just bad code?

Like what would need to happen for 10G?
A full fresh rewrite, or just a bit more kicking the code to work?

1 Like

I am perfectly aware of those, we had basic offloading working a while ago but it was dropped.

Its just too much of a hack, constantly breaks, requires legacy stuff that was dropped like 10 years ago etc

1 Like

Anyone doing VLANs over B.A.T.M.A.N on 802.11s mesh? I can't see to get some traffic (e.g. DHCP) to flow. In a basic setup with a gateway and a dumb AP and a DHCP example, I see the full DHCP sequence (discover, offer, request, ack) on the gateway. On the dumb AP, I see the whole sequence up to the bat0 interface, but once that traffic hits the WLAN interface I never see that ACK.

I tested this with the 301w as the gateway and a Redmi AX6000 as a dumb AP, then made an identical config with just two Redmi AX6000s and it worked fine there. Assigning a static IP works. Can't for the life of me get DHCP to function.

More details:
301W: Gateway
AX6000: Dumb AP

802.11s on both, peer forwarding disabled. batctl shows neighbors are reachable, putting an IP works fine and I can ICMP fine.

Both devices have one bridge br with 5 VLAN tags. bat0 is added as a member to br and all 5 VLANs are tagged. Here's some TCP dumps.

Gateway (301w) on br.2 (IOT VLAN)

00:33:02.167779 xx:xx:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: (tos 0x0, ttl 255, id 35097, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from xx:xx:xx:xx:xx:xx, length 300, xid 0x61f4edfd, Flags [none] (0x0000)
Client-Ethernet-Address xx:xx:xx:xx:xx:xx
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message (53), length 1: Discover
Parameter-Request (55), length 9:
Subnet-Mask (1), Classless-Static-Route (121), Default-Gateway (3), Domain-Name-Server (6)
Domain-Name (15), Unknown (108), URL (114), Unknown (119)
Unknown (252)
MSZ (57), length 2: 1500
Client-ID (61), length 7: ether xx:xx:xx:xx:xx:xx
Lease-Time (51), length 4: 7776000
00:33:02.168865 yy:yy:yy:yy:yy:yy > xx:xx:xx:xx:xx:xx, ethertype IPv4 (0x0800), length 343: (tos 0xc0, ttl 64, id 42425, offset 0, flags [none], proto UDP (17), length 329)
10.0.2.1.67 > 10.0.2.16.68: [bad udp cksum 0x1957 -> 0xae74!] BOOTP/DHCP, Reply, length 301, xid 0x61f4edfd, Flags [none] (0x0000)
Your-IP 10.0.2.16
Server-IP 10.0.2.1
Client-Ethernet-Address xx:xx:xx:xx:xx:xx
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message (53), length 1: Offer
Server-ID (54), length 4: 10.0.2.1
Lease-Time (51), length 4: 43200
RN (58), length 4: 21600
RB (59), length 4: 37800
Subnet-Mask (1), length 4: 255.255.255.0
BR (28), length 4: 10.0.2.255
Default-Gateway (3), length 4: 10.0.2.1
Domain-Name (15), length 3: "lan"
Domain-Name-Server (6), length 8: 10.0.0.102,10.0.0.163
00:33:03.180637 xx:xx:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: (tos 0x0, ttl 255, id 35098, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from xx:xx:xx:xx:xx:xx, length 300, xid 0x61f4edfd, secs 1, Flags [none] (0x0000)
Client-Ethernet-Address xx:xx:xx:xx:xx:xx
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message (53), length 1: Request
Parameter-Request (55), length 9:
Subnet-Mask (1), Classless-Static-Route (121), Default-Gateway (3), Domain-Name-Server (6)
Domain-Name (15), Unknown (108), URL (114), Unknown (119)
Unknown (252)
MSZ (57), length 2: 1500
Client-ID (61), length 7: ether xx:xx:xx:xx:xx:xx
Requested-IP (50), length 4: 10.0.2.16
Server-ID (54), length 4: 10.0.2.1
00:33:03.182329 yy:yy:yy:yy:yy:yy > xx:xx:xx:xx:xx:xx, ethertype IPv4 (0x0800), length 343: (tos 0xc0, ttl 64, id 42429, offset 0, flags [none], proto UDP (17), length 329)
10.0.2.1.67 > 10.0.2.16.68: [bad udp cksum 0x1957 -> 0xab73!] BOOTP/DHCP, Reply, length 301, xid 0x61f4edfd, secs 1, Flags [none] (0x0000)
Your-IP 10.0.2.16
Server-IP 10.0.2.1
Client-Ethernet-Address xx:xx:xx:xx:xx:xx
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message (53), length 1: ACK
Server-ID (54), length 4: 10.0.2.1
Lease-Time (51), length 4: 43200
RN (58), length 4: 21600
RB (59), length 4: 37800
Subnet-Mask (1), length 4: 255.255.255.0
BR (28), length 4: 10.0.2.255
Default-Gateway (3), length 4: 10.0.2.1
Domain-Name (15), length 3: "lan"
Domain-Name-Server (6), length 8: 10.0.0.102,10.0.0.163

DHCP ACK never makes it to br.2 on the AX6000/dumb AP. bad udp cksum 0x1957 -> 0xab73! looks like it might be the culprit. Related? [solved] DHCP on VLAN interfaces - #5 by oofnik iptables aren't used any more, might have to dig in.

Anyone have ideas/suggestions?

Anyone having issues with their WAN speeds on this device? If I run a speediest direction on it, I see full ~1400mbit down, but once it NATs I can't seem to break 400. Checked on a 10g NIC, 1G NIC and over wireless as well. Can't get any faster than ~400.

Can you explain your test case more precise?
But only 400mbit sounds way to low, even with NAT + PPPOE the QNAP can do more.