Sitecom WLR-7100 development/progress

I also had a look in the sources for the stock firmware (Found here, the v1 001 version has a broken link, I've already asked sitecom about that) for the ethreg utility and the corresponding kernel code. From that it seems that this tool actually reads registers inside the PHY (the switch in this case), not registers related to the eth gmac in the SoC itself. So I guess we can use that to see if the stock firmware configures the PHY for delay, not if it configures the GMAC for delay (but I'm going to see if I can get the OpenWRT devmem binary working on the stock firmware, if I can find some way to copy files onto it...).

Edit: I've partly figured out how to use ethreg in the stock firmware

You can read registers for the phy attached to each switch port, passing the port number with -p (it seems the ports are numbered in reverse from how they are numbered on the casing, though). This corresponds to the "PHY control registers" section (5.9) in the QCA8337 datasheet. E.g. to read the "Status register" and "PHY identifier" for port 0 respectively:

# ethreg -p 0 1
Read Reg: 0x00000001 = 0x0000796d
# ethreg -p 0 2
Read Reg: 0x00000002 = 0x0000004d

According to the kernel sources, port 0xf is special and triggers another register read function. I would suspect this allows reading global registers in the 8337, but somehow this fails:

# ethreg -p 15 0x0 
regread ioctl error
ethreg: eth0: Invalid argument

I'm not really sure how this is possible, though, reading the kernel sources I can't even see how this ioctl could even return EINVAL at all. Oh well.

Wow matthijs, I'm impressed!

May I conclude a delay of 1 (instead of 0) is sufficient to fix the packet loss (in ping at least) and the thing to test if that setting does not break the v1.001 board?

That's one test, the other is too see what the stock firmware does (see below).

Turns out the router has an USB port, so getting files on and off is easy :slight_smile: I copied both /sbin/devmem and /lib/ld-musl-mips-sf.so.1 from OpenWRT into the stock firmware (into the proper places - I tried keeping them elsewhere and use LD_LIBRARY_PATH which didn't work, probably because that is used by the dynamic linker to find libraries, not by the kernel to find the linker in the first place).

So the stock firmware actually sets the GMAC delay registers:

# devmem 0x18070000
0x0003C001

This means ETH_RXDV_DELAY=3 and ETH_RXD_DELAY=3, and both of the TX delays at 0.

I will also check the working board to see if that sets different values (but I'm going to guess it doesn't, and that board is just lucky that it works because of subtle changes in silicon between different chip revisions or even different chips).

I also looked in the stock firmware kernel sources to see if they ever set these values, and I couldn't find anything (but maybe this happens in a non-obvious place using hardcoded values instead of proper constants, or maybe it happens in some script rather than the kernel.., who knows...).

Checking the pll register value in the stock firmware shows it also matches the OpenWRT value:

# devmem 0x1805002C
0x06000000

(for reference, the 0x2C register offset comes from the pll reg attribute plus the second element of the eth0 pll-reg attribute, the pll-data defined in the OpenWRT DTS is for Gbps, 100Mbps, 10Mbps respectively, and this is an internal link that is always 1Gbps, so only the first value, 0x06000000, is relevant)

Looking more closely at the kernel code, it seems the ethreg global register reading code (triggered by -p 15, but failing) actually almost matches the QCA8337 datasheet (except for some magic numbers)ull, but the port-specific PHY register reading code (which does seem to work) does not match the datasheets (it uses register 0x98 for accessing the PHY-port registers, but that is the HEADER_CTRL register according to the datasheet.

I guess I might be looking at the wrong bit of code, or the sources I'm looking at are not the right sources for this board. So I'm going to be slightly distrustful of the ethreg output. Also, this means I cannot really verify whether the stock firmware sets up any (TX) delays in the PHY.

I've also tried bitbanging the right MII registers based on the 9344 and 8337 datasheets and current kernel sources using devmem, which seems to work. Here's the script for that, in case it's useful for anyone else:

# readreg.sh
# This script reads QCA8337 (and compatible) switch global registers
# through AR9344 (and compatible) MII control registers by poking directly
# in memory. This is probably slightly dangerous and will probably crash
# things if the kernel also happens to access these registers at the same
# time.
REG=$1

devmem 0x19000028 32 0x1800 # MII_ADDR
devmem 0x1900002C 32 $((REG >> 9)) # MII_CTRL

PHYNUM=$(((REG >> 6) & 0x7 | 0x10))
PHYREG=$(((REG >> 1) & 0x1e))
devmem 0x19000024 32 0 # MII_CMD
devmem 0x19000028 32 $((PHYNUM << 8 | PHYREG)) # MII_ADDR
devmem 0x19000024 32 1 # MII_CMD
LO=$(devmem 0x19000032 16) # MII_STATUS + 2

PHYREG=$((PHYREG | 0x1))
devmem 0x19000024 32 0 # MII_CMD
devmem 0x19000028 32 $((PHYNUM << 8 | PHYREG)) # MII_ADDR
devmem 0x19000024 32 1 # MII_CMD
HI=$(devmem 0x19000032 16) # MII_STATUS + 2

printf "0x%08x = 0x%04x%04x\n" "$REG" "$HI" "$LO"

I verified it works by reading rregister 0x0 (MASK_CTRL), bits 15:8 are the device ID which should be 0x13:

# ./readreg.sh 0x0
0x00000000 = 0x00001302

Here's a full dump of the QCA8337 registers in the stock firmware on the "broken" board:

# for r in 0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224; do ./readreg.sh $r; done
0x00000000 = 0x00001302
0x00000004 = 0x87a00000
0x00000008 = 0x01000000
0x0000000c = 0x01000000
0x00000010 = 0x80000000
0x00000014 = 0xf0107650
0x00000018 = 0x0000a980
0x0000001c = 0x00003f1f
0x00000020 = 0x3f170a00
0x00000024 = 0x000100ff
0x00000028 = 0x00000000
0x0000002c = 0x00000000
0x00000030 = 0x80000304
0x00000034 = 0x00000000
0x00000038 = 0x0f000000
0x0000003c = 0x00000000
0x00000040 = 0x20700aaa
0x00000044 = 0x00000000
0x00000048 = 0x000088a8
0x0000004c = 0x00000000
0x00000050 = 0xcf35cf35
0x00000054 = 0xcf35cf35
0x00000058 = 0xcf35cf35
0x0000005c = 0x03ffff00
0x00000060 = 0x00000001
0x00000064 = 0x00000000
0x00000068 = 0x00000000
0x0000006c = 0x00000000
0x00000070 = 0xb00ee060
0x00000074 = 0x03707f07
0x00000078 = 0x00002400
0x0000007c = 0x0000007e
0x00000080 = 0x80001ffd
0x00000084 = 0x00001280
0x00000088 = 0x00001280
0x0000008c = 0x00001280
0x00000090 = 0x00001280
0x00000094 = 0x0000007e
0x00000098 = 0x0001aaaa
0x0000009c = 0x00000002
0x000000a0 = 0x00000000
0x000000a4 = 0x00000000
0x000000a8 = 0x00000000
0x000000ac = 0x00000000
0x000000b0 = 0x00000000
0x000000b4 = 0x00000000
0x000000b8 = 0x00000000
0x000000bc = 0x00000000
0x000000c0 = 0x00000000
0x000000c4 = 0x00000000
0x000000c8 = 0x80901040
0x000000cc = 0x00000000
0x000000d0 = 0xfffbff7e
0x000000d4 = 0x00000001
0x000000d8 = 0x00000100
0x000000dc = 0x000303ff
0x000000e0 = 0xc70164c0

Some interesting observations:

  • The port connected to the CPU is probably PORT0, since its CTL register 0x4 has some values, while PORT5_PAD_CTL (0x8) and PORT6_PAD_CTL (0xC) have just one bit set. I couldn't actually find in the OpenWRT DTS file where it is define what switch port is which (even more, I couldn't even find the compatible = "qca,ar8327" that I think would trigger the right driver for the switch, so maybe there are some hardcoded defaults, or I didn't look in the right places).
  • Bit 31 of PORT0_PAD_CTL is set, which means MAC06_EXCHANGE_EN, which exchanges MAC0 and MAC6 (so maybe the hardware is wired to port 6 after all?).
  • The OpenWRT dts file sets some of these registers as well, to identical values as the stock firmware (except for bit 8 of the STATUS registers, but that is a read-only link status value so should not make a difference)
  • The PORT0_PAD_CTRL register (0x4) has value 0x87a00000 which means MAC0_RGMII_EN | MAC0_RGMII_TXCLK_DELAY_EN | MAC0_RGMII_RXCLK_DELAY_EN | MAC0_RGMII_TXCLK_DELAY_SEL(2) | MAC0_RGMII_RXCLK_DELAY_SEL (2) (note that the datasheet does not show MAC0_RGMII_RXCLK_DELAY_EN, but according to kernel sources that is bit 24). This means that the PHY is configured to apply delays on TX and RX, but apparently that is not actually enough? Also, OpenWRT applies the same delays (at least they are listed in the dts file), so nothing to be gained there.
  • It is actually weird that both the PHY and the GMAC apply a delay for the RX signal. I'm not sure about the units for this delay, but I understand that the goal is 2ns delay, so maybe 2 in the PHY means 2ns? If 3 in the GMAC also means 3ns, then that would add up to 5ns delay, which is more than half the RGMII clock period (8ns), given this is DDR, that would be too much. Weird...
  • I suspect that some if not all of the settings in the qca,ar8327-initvals attribute can be more semanticaly set using other DT properties (such as using phy_mode = "rgmii-rxid" for enabling a RX/TX delay value of 2, or using qca,ignore-power-on-sel to set that one bit in PWS_REG_VALUE, but I'm not sure if this is actually worth the trouble...

For good measure, here's also a dump of the GMAC0 config registers from stock firmware which might or might not be relevant (I left out the second half of the registers, which seem to be mostly status registers and counters, and the registers for GMAC1 which is unused):

# for r in 419430400 419430404 419430408 419430412 419430416 419430420 419430424 419430428 419430432 419430436 419430440 419430444 419430448 419430452 419430456 419430460 419430464 419430468 419430472 419430476 419430480 419430484 419430488 419430492; do printf "%08x = " $r; devmem $r; done

19000000 = 0x0000002F
19000004 = 0x00007215
19000008 = 0x40605060
1900000c = 0x00A1F037
19000010 = 0x00000600
19000014 = 0x00000000
19000018 = 0x00000000
1900001c = 0x00000000
19000020 = 0x0000000B
19000024 = 0x00000000
19000028 = 0x00000411
1900002c = 0x00004007
19000030 = 0x00000010
19000034 = 0x00000000
19000038 = 0x00000000
1900003c = 0x00000008
19000040 = 0x00026FB2
19000044 = 0x10010000
19000048 = 0x001F1F00
1900004c = 0x0010FFFF
19000050 = 0x03FF0155
19000054 = 0x01F00140
19000058 = 0x0003FFFF
1900005c = 0x000E6BE2

Ok, so a lot of things learned. Next steps are:

  • Dump registers with stock firmware on my other board, to confirm that uses the same values
  • Create an image with the right gmac delays (copied from stock) and test that on both my boards. I'll also publish the image somewhere, would be great if @Dock can then also test on their two boards.
  • If this works everywhere, submit the patch to OpenWRT.

I also checked the stock firmware on my other board:

  • ETH_CFG register - identical
  • PLL register - identical
  • 8337 registers - identical except bit 31 in register 0x80 (PORT1_STATUS), but that's documented as reserved, so probably not a configuration difference.
  • GMAC0 registers are mostly identical, except the MII_* registers, which are used to read MII registers (so reflect the address and value of the last read).

So: It seems likely that the stock firmware does not distinguish different versions, but just sets the same settings unconditionally and those apparently work with all versions.

I realized I forgot to dump the actual PHY registers (i.e. of the 5 PHYs connected to the external LAN and WAN ports on the 8337 switch). They're probably not relevant, but just in case, here's their values with the stock firmware (again snipped some counter and debug registers):

for p in 0 1 2 3 4; do echo Port $p; for r in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14; do ethreg -p $p $r; done; done
Port 0                           
Read Reg: 0x00000000 = 0x00001000
Read Reg: 0x00000001 = 0x0000796d
Read Reg: 0x00000002 = 0x0000004d
Read Reg: 0x00000003 = 0x0000d036
Read Reg: 0x00000004 = 0x00000de1
Read Reg: 0x00000005 = 0x000045e1
Read Reg: 0x00000006 = 0x00000005
Read Reg: 0x00000007 = 0x00002001
Read Reg: 0x00000008 = 0x00000000
Read Reg: 0x00000009 = 0x00000200
Read Reg: 0x0000000a = 0x00000000
Read Reg: 0x0000000b = 0x00000000
Read Reg: 0x0000000c = 0x00000000
Read Reg: 0x0000000d = 0x00004007
Read Reg: 0x0000000e = 0x00000000
Port 1                           
Read Reg: 0x00000000 = 0x00001000
Read Reg: 0x00000001 = 0x00007949
Read Reg: 0x00000002 = 0x0000004d
Read Reg: 0x00000003 = 0x0000d036
Read Reg: 0x00000004 = 0x00000de1
Read Reg: 0x00000005 = 0x00000000
Read Reg: 0x00000006 = 0x00000004
Read Reg: 0x00000007 = 0x00002801
Read Reg: 0x00000008 = 0x00000000
Read Reg: 0x00000009 = 0x00000200
Read Reg: 0x0000000a = 0x00000000
Read Reg: 0x0000000b = 0x00000000
Read Reg: 0x0000000c = 0x00000000
Read Reg: 0x0000000d = 0x00000000
Read Reg: 0x0000000e = 0x00000000
Port 2                        
Read Reg: 0x00000000 = 0x00001000
Read Reg: 0x00000001 = 0x00007949
Read Reg: 0x00000002 = 0x0000004d
Read Reg: 0x00000003 = 0x0000d036
Read Reg: 0x00000004 = 0x00000de1
Read Reg: 0x00000005 = 0x00000000
Read Reg: 0x00000006 = 0x00000004
Read Reg: 0x00000007 = 0x00002801
Read Reg: 0x00000008 = 0x00000000
Read Reg: 0x00000009 = 0x00000200
Read Reg: 0x0000000a = 0x00000000
Read Reg: 0x0000000b = 0x00000000
Read Reg: 0x0000000c = 0x00000000
Read Reg: 0x0000000d = 0x00000000
Read Reg: 0x0000000e = 0x00000000
Port 3
Read Reg: 0x00000000 = 0x00001000
Read Reg: 0x00000001 = 0x00007949
Read Reg: 0x00000002 = 0x0000004d
Read Reg: 0x00000003 = 0x0000d036
Read Reg: 0x00000004 = 0x00000de1
Read Reg: 0x00000005 = 0x00000000
Read Reg: 0x00000006 = 0x00000004
Read Reg: 0x00000007 = 0x00002801
Read Reg: 0x00000008 = 0x00000000
Read Reg: 0x00000009 = 0x00000200
Read Reg: 0x0000000a = 0x00000000
Read Reg: 0x0000000b = 0x00000000
Read Reg: 0x0000000c = 0x00000000
Read Reg: 0x0000000d = 0x00000000
Read Reg: 0x0000000e = 0x00000000
Port 4
Read Reg: 0x00000000 = 0x00001000
Read Reg: 0x00000001 = 0x00007949
Read Reg: 0x00000002 = 0x0000004d
Read Reg: 0x00000003 = 0x0000d036
Read Reg: 0x00000004 = 0x00000de1
Read Reg: 0x00000005 = 0x00000000
Read Reg: 0x00000006 = 0x00000004
Read Reg: 0x00000007 = 0x00002801
Read Reg: 0x00000008 = 0x00000000
Read Reg: 0x00000009 = 0x00000200
Read Reg: 0x0000000a = 0x00000000
Read Reg: 0x0000000b = 0x00000000
Read Reg: 0x0000000c = 0x00000000
Read Reg: 0x0000000d = 0x00000000
Read Reg: 0x0000000e = 0x00000000

Comparing stock firmware registers with OpenWRT registers (with the delay patching applied):

  • ETH_CFG register - identical
  • PLL register - identical
  • 8337 registers are largely identical, with some changes (see below). Nothing that stands out as incorrect.
  • GMAC0 registers are largely identical, with some changes (see below). Nothing that stands out as incorrect.
  • 8337 PHY (per-port) registers not checked, since I did not have a working ethreg available on OpenWRT (and it did seem worth the trouble of putting another layer on top of my readreg.sh just to compare them).
--- 8337.stock       2023-08-31 20:28:57.339128904 +0200
+++ 8337.owrt        2023-08-31 20:28:59.954953884 +0200
@@ -6,11 +6,11 @@
# Interrupt registers, probably not relevant
-0x00000020 = 0x3f170a00
+0x00000020 = 0x3f500a02
-0x00000024 = 0x000100ff 
+0x00000024 = 0x00010087
# MODULE_EN, stock enables L3_EN (0x4) and some reserved bits
-0x00000030 = 0x80000304
+0x00000030 = 0x80000000
# MAX_FRAME_SIZE, stock configures 9216 bytes, OpenWRT 9028
-0x00000078 = 0x00002400
+0x00000078 = 0x00002344
# PORT_x_STATUS registers, probably not relevant
-0x0000007c = 0x0000007e
+0x0000007c = 0x000000fe
-0x00000080 = 0x80001ffd
+0x00000080 = 0x00001f7d
-0x00000084 = 0x00001280
+0x00000084 = 0x00001200
-0x00000088 = 0x00001280
+0x00000088 = 0x00001200
-0x0000008c = 0x00001280
+0x0000008c = 0x00001200
-0x00000090 = 0x00001280
+0x00000090 = 0x00001200
-0x00000094 = 0x0000007e
+0x00000094 = 0x000000fe
# HEADER_CTRL, stock uses 4-byte header with 0xaaaa header type value, OpenWRT 2-byte header type value
-0x00000098 = 0x0001aaaa
+0x00000098 = 0x00000000
# PORT0_HEADER_CTRL, stock configures all frames with headers, OpenWRT configures no headers
-0x0000009c = 0x00000002
+0x0000009c = 0x00000000
--- gmac0.stock       2023-08-31 20:32:33.467169638 +0200
+++ gmac0.owrt        2023-08-31 20:32:34.507122738 +0200
@@ -1,22 +1,24 @@
# MAC Configuration 1, stock sets RX_FLOW_CONTROL here
-19000000 = 0x0000002F
+19000000 = 0x0000000F
# Maximum Frame Length, stock sets 1536, OpenWRT sets 1524
-19000010 = 0x00000600
+19000010 = 0x000005F4
# MII Configuration, stock sets MII clkdiv to /58, OpenWRT to /50
-19000020 = 0x0000000B
+19000020 = 0x0000000A
# MII access registers - not relevant
-19000028 = 0x00000411
+19000028 = 0x0000111F
-1900002c = 0x00004007
+1900002c = 0x00000000
-19000030 = 0x00000010
+19000030 = 0x00000000
# STA Address 1/2 - stock and OpenWRT apparently configure a different MAC address, but this is just eth0, not the VLAN devices that are actually used.
-19000040 = 0x00026FB2
+19000040 = 0xD021F3FE
-19000044 = 0x10010000
+19000044 = 0x38EE0000
# ETH Configuration 2, XON/XOFF flow control thresholds
-19000050 = 0x03FF0155
+19000050 = 0x015500AA
# ETH Configuration 4, stock sets "frame truncated" and "unicast address match" condition bits (but these conditions are ignored by OpenWRT anyway, so their values do not matter there).
-19000058 = 0x0003FFFF
+19000058 = 0x0000FFFF
# ETH Configuration 5, OpenWRT ignores extra frame drop conditions (drop event, falser carrier, code error, dribble nibble, long event, frame truncated).
-1900005c = 0x000E6BE2
+1900005c = 0x000FEFEF

Next up: Checking a newly generated image on my both boards.

Sorry, today I had very wonky internet connection, so even receiving a mail was a problem, which delayed my response.

With ethreg we are actually asking (we can also write) PHY/Switch connected to mdio interface for registers. What I wanted to know is if both revisions have the same register values on vendor firmware. We write the ones which differ from default values as qca,ar8327-initvals in dts. To know which registers to check look in Table 5-3 from QCA8337N_Data_Sheet_MKG-17793_v1.0.pdf, an example of invocation ethreg 0x10 should return 0x80000000 in our case. If for all board registers are same, we can ignore initial switch setup and focus on the delays. All other registers are configured as requested by your typical network tools, so we don't need to bothered.
BTW ethreg is a tool from Atheros LSDK, it was never part of busybox or any open source project.

As far as I can understand pll-data seem to be xMII reference clock, which is set when interface is brought up, so You can't fiddle with it when it's already running (check explanation in 9.5.10 paragraph of AR9344 datasheet). As I understand it, for correcting timings on the fly we have the tx or/and rx delays.

For ath79 target we are still using old swconfig drivers, check target/linux/generic/files/drivers/net/phy dir for source. There is a PR https://github.com/openwrt/openwrt/pull/4622 converting all switch users to DSA driver, but it's stalled by all devices having various range of configurations.

So in all, it seems setting rx delays and testing on all variants is everything we need. Great job.

PS
All bits set in vendor firmware for the switch are in GPL_RELEASE/ISD2/configs/product_config.make starting from CONFIG_ATH_S17_PROPRIETARY_INIT symbol, but I asked to check on all variants, since I didn't know if the same source was used for them.

Right, I had that figured out :slight_smile:

Right, the only relevant Google hit I could find was this source file, part of some busybox fork, so apparently someone integrated it into busybox at some point. But I noticed it was standalone in the WLR-7100 firmware source later, yeah.

Ah right, I knew that, but didn't realize that that would be relevant here. So I was looking at the wrong code, right :slight_smile:

Oh, hadn't expected initialization values to be there, thanks for pointing that out. I can't quite see how these values are actually used though (grepping for their names gives me just the config), but it doesn't really matter anyway.

The binary images are the same for all variants (even though they are seperate downloads with separate names, contents are identical), so I'm going to assume the source is too :slight_smile:

  • Ok, so I did some more testing - seems to work just fine on both my WLR-7100 routers. I've connected my laptop behind this router now to see if any problems arise in actual usage.
  • I created a PR at https://github.com/openwrt/openwrt/pull/13385 (marked as draft until we do some additional testing). @tmn505 maybe you can review it?
  • I've built an image from that version, which is I uploaded to my own webserver. @Dock would you maybe test that image? It's mostly a default configuration, except for enabling /dev/mem. It does not have luci (but I think that can be opkg install'ed

Will do, after I get around to test it on my device, it's not reachable at the moment.

I will try testing your image on my v1.002. I have limited time though and I am not so familiar with linux openwrt command line instructions. If installing luci works I can do some testing.

As I understand, your image will install with sysupgrade. What if I set "keep settings" and make sure the wifi radios are enabled before installing?

Yeah, the image can be installed using sysupgrade, or uploaded through the WebUI.

I would expect that keep settings would work fine, especially if you're upgrading from a recent version (e.g. 23.05-rc, but probably also 22.x), but I do not have a lot of experience here.

To make it easier for you, I just started another build that includes luci (I used the official 23.05-rc3 config, so the image should have the same contents as that image, except it is built from git master plus this fix and with /dev/mem enabled). It will probably take a while, I'll let you know when it is done.

@Dock I take it you won't be able to test on your v1.001? I guess it would have some value if we could test on both revisions, and I think yours is the only v1.001 I know of (unless @tmn505 also has one). Not a blocker though, it seems they are identical enough that it should just work :slight_smile:

Hm, this build seems to fail (for unrelated reasons, kernel fails with error: /home/matthijs/docs/src/upstream/openwrt/staging_dir/target-mips_24kc_musl/usr/include: No such file or directory), and I can't free up the time to investigate now, so I hope you can test with the original image.

I just tested if luci would install on the original image, and that seems to work fine: opkg update && opkg install luci (it shows a bunch of errors about kernel modules that could not be installed, but most of them seem to be present already, and luci seems to work without them).

Today I did the test on v1 002:

vanilla | patched
no loss | no loss | 1000Mbps
~0,2%   | no loss | 100Mbps
~0,5%   | ~0,5%   | 10Mbps

So it looks like success, except 10mbps, but I don't think anyone would be bothered by that.

@Dock
I've made images using OpenWrt ImageBuilder for 21.02.7, 22.03.5 and 23.05.0-rc3 with LuCI, You or anyone wanting to test can download them from: https://www.mediafire.com/file/wd7brnt0nltg98v/wlr7100.zip/file
These images can install packages from official feed.

What I did with each version of ImageBuilder:

  1. decompile build_dir/target-mips_24kc_musl/linux-ath79_generic/image-ar1022_sitecom_wlr-7100.dtb file with dtc.
  2. patch gmac node.
  3. compile back to a dtb file.
  4. make images with make image PROFILE="sitecom_wlr-7100" PACKAGES="luci"

BTW.
I think it's time to move our device from ath79/generic to ath79/tiny subtarget. With generic image from 23.05.0-rc3 we have 1,25 MiB space for data, after moving it to tiny it has 1,93 MiB. The RAM usage difference oscillates between 1-2 MiB.

ath79/generic:

ath79/tiny:

Thanks Mathijs,

This just convinced me to start testing, possibly tonight, but definitely tomorrow.

About the free memory left for this 64MB device, you may want to replace your WLR-7100 with a WLR-8100 device. Twice the memory and faster CPU. The current rc3 version works on all versions (I think there are two) of the WLR-8100. The WLR-8100 is well available (in the Netherlands at least) and almost free.

Tested your modified image rc3 on my WLR-7100 V1.002. on radio0 download is 14 Mbs download (should be around 95 Mbs)

I installed your image with sysupgrade, keep settings. Would it make a difference to do a clean install?

Existing rc3 is around 11 Mbs download on radio0.

It does make a small difference, but not significant.

I do not know how to easily test for packetloss on the wired connections.

I also tested your modified image on my WLR-7100 v1.001.

No difference from the existing rc3 image. Download on radio0 consistent with my internet download speed.

Hm, I'm a bit surprised that the link speed even matters at all, since the CPU-switch link is always 1000Mbps? Or are you changing the CPU-switch link speed manually (I didn't when I tested before, and did have packet loss at 1000Mbps).

I used this command for testing:

ping 192.168.2.1 -s 1400 -i .01

Hm, but that's wifi, so maybe there's a different problem in the wifi part? Would be good if you could test wired-to-wired as well, to at least confirm that this particular problem is solved, and then the wireless issue could be separately investigated (though I personally do not use the wireless anymore, so I have little interest in investigating that).

In the meanwhile, my PR got merged to master (should appear in the next snapshot builds), and backported to 23.05 (should appear in rc4 and/or the final release) and 22.03 (should appear in the next point release AFAIU).

@Dock and @tmn505 Thanks for your input and testing! @tmn505 especially thanks for providing exactly the bit of information I needed to continue debugging. Without that, I probably would have gotten stuck and given up, so perfect timing :‐)

Thanks for submitting the patch.

@Dock I've tested each version I posted and the results didn't differ much from numbers I posted here previously. When downloading through wifi or lan software interrupts consume around 85% of CPU and given that this is single core we can't distribute them to another core. Without the propriety "magic" in vendor firmware we are hitting the max of what this hardware is capable of. The best results were on 22.03.5 with software flow offloading enabled in Network>Firewall (slightly better than Sitecom WLR-7100 development/progress - #20 by tmn505). So stick to 22.03.x version or revert to vendor firmware, that's the only choice we have.

I will test the wired connection of my v1.002 at a later point in time. I do not have the time right now.

But I suspect it will be good and just the WiFi is affected. It might be that just this device has an hardware issue.

As said, I use one WLR-7100 V1.001 in my network which works flawless, but I prefer the Sitecom WLR-8100 for it's better specs, which runs (both v1.001 and v1.002) without any issues on the latest openwrt (rc3) firmware.

Thanks for making the new firmware revisions work better on the WLR-7100 V1.002.