as21xxx: AS21010 fw 1.9.1 frame-length drops (VEND1 0x103c) and, phantom test-pattern frames on BPI-R4 Pro
Subsystems (2)
Hi Christian,
I see two receive-side problems with the AS21010 on the 10G RJ45 LAN port of a Banana Pi BPI-R4 Pro 8X. Both look like firmware issues, and as you submitted the AS21x1x firmware to linux-firmware I hope you can pass them on to Aeonsemi.
Setup:
- BPI-R4 Pro 8X (MT7988A), lan-phy variant
- MxL86252C port 13, USXGMII with in-band status, MxL firmware 1.0.85
- AS21010 at address 0x18, firmware 1.9.1 (linux-firmware aeonsemi/as21x1x_fw.bin)
- OpenWrt main r38555-fb742de8e5, kernel 6.18.64
- Link partner: Realtek RTL8127 (r8169, rtl8127a-1 0.0.5), 10GBASE-T over about 50 m of installed copper, AS21010 is master
- Traffic direction: link partner -> AS21010 (RJ45 receive)
1) Frame-length dependent drops, VEND1 0x103c bits 8:3
Another user (forum link below) disassembled firmware 1.9.2 and found that at 2.5G and above it sets VEND1 0x103c bits 8:3 to 3 (8 below 2.5G), and that with 3 the MxL drops received frames depending on their length modulo 16. He patched the binary to use 8.
Firmware 1.9.1 sets the same value here: VEND1 0x103c = 0xa01e at 10G. I changed only bits 8:3 at runtime:
mdio mdio-bus mmd 0x18:30 raw 0x103c 0xa046
UDP, 4 Gbit/s, 20 s per run, frames received on the RJ45 port:
frame size field = 3 (stock) field = 8 1518 B 0 % loss 0.0002 % (12 of 6.8 M) 1510 B 1.4 % (96714 frames) 0 %
1514 B 0 % 0 %
No counter on the MxL port shows the lost frames. The value is set back to 3 on every link-up, so this only lasts until the next autoneg.
What does this field control, and can Aeonsemi provide a firmware with a value that works with the MxL86252C host interface?
2) Phantom 48-byte frames with valid CRC, hours after link-up
Hours after a clean link-up (today: first CRC errors after 2 h, full phase after 6.5 h), lan6 starts receiving frames that the link partner never sent. Measured over the same 10 s on both ends:
link partner tx_packets (r8169 MAC) 172 lan6 eth-mac-FramesReceivedOK 18734 lan6 rmon-etherStatsUndersizePkts 18587
Every one of them is the same frame. As captured on the CPU port, after the switch added the PVID 20 tag:
00:00:01:01:01:01 > 00:00:00:00:00:00, 802.1Q vlan 20, length 56 0x0000: 0101 0202 0202 0202 0202 0303 0303 0303 0x0010: 0303 0404 0404 0404 0404 0505 0505 fe5a 0x0020: bf47 0000 0000
Without the VLAN tag the frame is 8 bytes each of 00, 01, 02, 03, 04, then 4 bytes of 05 (44 bytes), followed by fe 5a bf 47, which is the correct CRC32 (little-endian) of those 44 bytes.
- Rate: bursts of about 37 frames within 0.5 ms, every 10 to 45 ms, about 1850 frames/s, independent of the real traffic.
- Only the RJ45 receive direction is affected; the other direction counts match.
- While it runs, rx_dropped on lan6 climbs by up to 2.4 M per minute and throughput falls from 9.3 Gbit/s to about 1 Gbit/s down and 130 Mbit/s up.
- Pause frames stay at 0 on both sides; MxL temperature is flat at about 60 C.
- "ethtool -r lan6" stops it at once, until the next phase.
- The same link partner had no such phases when it was connected to an SFP+ 10GBASE-T module on a BPI-R4 (non-Pro).
A valid CRC over an incrementing 8-byte pattern does not look like line errors; it looks like a frame generator, and the AS21010 has a MAC of its own (see the 0x103c field). Does the firmware contain a test-frame or packet generator with this pattern, and what could enable it during normal operation? A pcap with these frames is available if useful.
This phase happened with the stock 0x103c value 3. I now run with 8 to see whether the phases are related to problem 1.
Side note: reading C45 registers of the AS21010 with mdio-tools on this board, every read returns the value of the previous read (the first read after another register shows that register's value). I have not checked whether this is mdio-netlink or the MDIO bus.
Forum thread with the 0x103c analysis:
https://forum.banana-pi.org/t/possible-firmware-issue-on-the-bpi-r4-pro-switched-10gbps-port/28482
Thanks,
Oli
Hi Christian,
a follow-up on problem 2. A second phase today shows where the phantom frames come from.
Since my first mail a logger on the board checks VEND1 0x103c every 10 s and sets bits 8:3 from 3 to 8 (the problem 1 workaround).
- The phase began 12.5 h after the previous "ethtool -r lan6", with no link-down in between. Same 48-byte frame as before.
- The field had stayed at 8 for those 12.5 h, so its value does not trigger the phases.
- From the minute the phantom frames started, the firmware wrote 3 into the field again, on every check, for 4.5 h until the retrain.
Timing test during the phase: write 8, read the field every 1.9 ms with mdio-tools, and record the phantom frames with tcpdump -tt. Seven runs gave a clear reset point (window corrected for the one-read lag from my first mail):
firmware resets field burst starts
(ms after write) (ms after write)
2.0 - 4.1 3.2
11.7 - 13.8 13.2
3.9 - 6.0 5.4
47.2 - 49.1 48.2
1.9 - 3.9 2.2
34.4 - 36.3 36.7
52.8 - 54.7 53.2
At about 20 bursts/s, a random burst falls into a 2 ms window about 4 % of the time. Six of seven start inside the window, one 0.4 ms after it (about one mdio read).
So during a phase the firmware keeps re-running the code that sets up the host side for the current speed, without a link change, and each run sends a burst of these frames to the MxL. A retrain ends it.
Questions for Aeonsemi:
- What makes the firmware repeat this while the link stays up?
- Is there a status register or IPC command that shows this state, so the driver could detect it and restart autoneg?
- What is the 00x8 01x8 02x8 03x8 04x8 05x4 frame?
Poll log and capture available on request.
Thanks,
Oli Z
Am 25.11.26 um 20:42 schrieb Oli Z.:
Quoted 102 lines
Hi Christian,
I see two receive-side problems with the AS21010 on the 10G RJ45 LAN port of a Banana Pi BPI-R4 Pro 8X. Both look like firmware issues, and as you submitted the AS21x1x firmware to linux-firmware I hope you can pass them on to Aeonsemi.
Setup:
- BPI-R4 Pro 8X (MT7988A), lan-phy variant
- MxL86252C port 13, USXGMII with in-band status, MxL firmware 1.0.85
- AS21010 at address0x18, firmware 1.9.1 (linux-firmware aeonsemi/as21x1x_fw.bin)
- OpenWrt main r38555-fb742de8e5, kernel 6.18.64
- Link partner: Realtek RTL8127 (r8169, rtl8127a-1 0.0.5), 10GBASE-T over about 50 m of installed copper, AS21010 is master
- Traffic direction: link partner -> AS21010 (RJ45 receive)1) Frame-length dependent drops, VEND1
0x103cbits 8:3Another user (forum link below) disassembled firmware 1.9.2 and found that at 2.5G and above it sets VEND1
0x103cbits 8:3 to 3 (8 below 2.5G), and that with 3 the MxL drops received frames depending on their length modulo 16. He patched the binary to use 8.Firmware 1.9.1 sets the same value here: VEND1
0x103c=0xa01eat 10G. I changed only bits 8:3 at runtime:mdio mdio-bus mmd 0x18:30 raw
0x103c0xa046UDP, 4 Gbit/s, 20 s per run, frames received on the RJ45 port:
frame size field = 3 (stock) field = 8 1518 B 0 % loss 0.0002 % (12 of 6.8 M) 1510 B 1.4 % (96714 frames) 0 %
1514 B 0 % 0 %No counter on the MxL port shows the lost frames. The value is set back to 3 on every link-up, so this only lasts until the next autoneg.
What does this field control, and can Aeonsemi provide a firmware with a value that works with the MxL86252C host interface?
2) Phantom 48-byte frames with valid CRC, hours after link-up
Hours after a clean link-up (today: first CRC errors after 2 h, full phase after 6.5 h), lan6 starts receiving frames that the link partner never sent. Measured over the same 10 s on both ends:
link partner
tx_packets(r8169 MAC) 172 lan6 eth-mac-FramesReceivedOK 18734 lan6 rmon-etherStatsUndersizePkts 18587Every one of them is the same frame. As captured on the CPU port, after the switch added the PVID 20 tag:
00:00:01:01:01:01 > 00:00:00:00:00:00, 802.1Q vlan 20, length 56 0x0000: 0101 0202 0202 0202 0202 0303 0303 0303 0x0010: 0303 0404 0404 0404 0404 0505 0505 fe5a 0x0020: bf47 0000 0000
Without the VLAN tag the frame is 8 bytes each of 00, 01, 02, 03, 04, then 4 bytes of 05 (44 bytes), followed by fe 5a bf 47, which is the correct CRC32 (little-endian) of those 44 bytes.
- Rate: bursts of about 37 frames within 0.5 ms, every 10 to 45 ms, about 1850 frames/s, independent of the real traffic.
- Only the RJ45 receive direction is affected; the other direction counts match.
- While it runs,rx_droppedon lan6 climbs by up to 2.4 M per minute and throughput falls from 9.3 Gbit/s to about 1 Gbit/s down and 130 Mbit/s up.
- Pause frames stay at 0 on both sides; MxL temperature is flat at about 60 C.
- "ethtool -r lan6" stops it at once, until the next phase.
- The same link partner had no such phases when it was connected to an SFP+ 10GBASE-T module on a BPI-R4 (non-Pro).A valid CRC over an incrementing 8-byte pattern does not look like line errors; it looks like a frame generator, and the AS21010 has a MAC of its own (see the
0x103cfield). Does the firmware contain a test-frame or packet generator with this pattern, and what could enable it during normal operation? A pcap with these frames is available if useful.This phase happened with the stock
0x103cvalue 3. I now run with 8 to see whether the phases are related to problem 1.Side note: reading C45 registers of the AS21010 with mdio-tools on this board, every read returns the value of the previous read (the first read after another register shows that register's value). I have not checked whether this is mdio-netlink or the MDIO bus.
Forum thread with the
0x103canalysis:
https://forum.banana-pi.org/t/possible-firmware-issue-on-the-bpi-r4-pro-switched-10gbps-port/28482Thanks,
Oli