[BPI-R4-PRO] Mainline OpenWRT

Wan-phy is interface wan (eth1)…have you bridged this interface to br-lan too?

What does ethtool -s tell you after the retransmitts shown in iperf3?

You can see this in the previous logs. :slight_smile:

root@BPI:~# ethtool -S eth0
NIC statistics:
     tx_bytes: 1712
     tx_packets: 16
     tx_skip: 0
     tx_collisions: 0
     rx_bytes: 0
     rx_packets: 0
     rx_overflow: 0
     rx_fcs_errors: 0
     rx_short_errors: 0
     rx_long_errors: 0
     rx_checksum_errors: 0
     rx_flow_control_packets: 0
     rx_xdp_redirect: 0
     rx_xdp_pass: 0
     rx_xdp_drop: 0
     rx_xdp_tx: 0
     rx_xdp_tx_errors: 0
     tx_xdp_xmit: 0
     tx_xdp_xmit_errors: 0
     s00_p06_TxDrop: 0
     s00_p06_TxCrcErr: 0
     s00_p06_TxCollision: 0
     s00_p06_RxDrop: 0
     s00_p06_RxFiltering: 16
     s00_p06_RxCrcErr: 0
     s00_p06_RxCtrlDrop: 0
     s00_p06_RxIngressDrop: 0
     s00_p06_RxArlDrop: 0

root@BPI:~# ls /sys/class/net/br-lan/brif/
lan1     lan2     lan3     lan4     lan5     lan6     sfp-lan
root@BPI:~# uci show network | grep -i br-lan
network.@device[0].name='br-lan'
network.lan.device='br-lan'

Wan is not eth0…eth0 is mac for internal switch.

This?

root@BPI:~# ip route get 192.168.31.1
192.168.31.1 dev wan src 192.168.31.112 uid 0
    cache
root@BPI:~# cat /etc/config/network

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        list ipaddr '127.0.0.1/8'

config globals 'globals'
        option dhcp_default_duid '0004942817c6a157598b8ac5bf0514bcb6ac'
        option ula_prefix 'fdc6:37b8:88de::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'lan1'
        list ports 'lan2'
        list ports 'lan3'
        list ports 'lan4'
        list ports 'lan5'
        list ports 'lan6'
        list ports 'sfp-lan'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        list ipaddr '192.168.1.1/24'
        option ip6assign '60'

config interface 'wan'
        option device 'wan'
        option proto 'dhcp'

config interface 'wan6'
        option device 'wan'
        option proto 'dhcpv6'

yes and here the stats were interesting, somehow my wan-phy does not come up completely…do not know why yet. in my running system i see an sfp-property which should not be there in phy-mode…i do not see it in my dts{,i,o} files…i try reflashing.

I hope it will be help to you

root@BPI:~# find /sys/firmware/devicetree/base/ -name “sfp”

/sys/firmware/devicetree/base/sfp1
/sys/firmware/devicetree/base/soc/ethernet@15100000/mdio-bus/switch@16/ports/port@13/sfp
/sys/firmware/devicetree/base/soc/ethernet@15100000/mac@1/sfp
/sys/firmware/devicetree/base/sfp2
/sys/firmware/devicetree/base/__symbols__/sfp1
/sys/firmware/devicetree/base/__symbols__/imux1_sfp1
/sys/firmware/devicetree/base/__symbols__/imux2_sfp2
/sys/firmware/devicetree/base/__symbols__/sfp2

root@BPI:~# ls -la /sys/firmware/devicetree/base/soc/ethernet@*

-r--r--r--    1 root     root             4 Sep  2 17:46 #address-cells
-r--r--r--    1 root     root             4 Sep  2 17:46 #size-cells
drwxr-xr-x    6 root     root             0 Jan  1  1970 .
drwxr-xr-x   63 root     root             0 Jan  1  1970 ..
-r--r--r--    1 root     root            48 Sep  2 17:46 assigned-clock-parents
-r--r--r--    1 root     root            48 Sep  2 17:46 assigned-clocks
-r--r--r--    1 root     root           324 Sep  2 17:46 clock-names
-r--r--r--    1 root     root           192 Sep  2 17:46 clocks
-r--r--r--    1 root     root            20 Sep  2 17:46 compatible
-r--r--r--    1 root     root            40 Sep  2 17:46 interrupt-names
-r--r--r--    1 root     root            96 Sep  2 17:46 interrupts
drwxr-xr-x    3 root     root             0 Jan  1  1970 mac@0
drwxr-xr-x    2 root     root             0 Jan  1  1970 mac@1
drwxr-xr-x    3 root     root             0 Jan  1  1970 mac@2
drwxr-xr-x    4 root     root             0 Sep  2 17:46 mdio-bus
-r--r--r--    1 root     root             4 Sep  2 17:46 mediatek,ethsys
-r--r--r--    1 root     root             4 Sep  2 17:46 mediatek,infracfg
-r--r--r--    1 root     root            12 Sep  2 17:46 mediatek,wed
-r--r--r--    1 root     root             9 Sep  2 17:46 name
-r--r--r--    1 root     root             4 Sep  2 17:46 phandle
-r--r--r--    1 root     root             4 Sep  2 17:46 pinctrl-0
-r--r--r--    1 root     root             8 Sep  2 17:46 pinctrl-names
-r--r--r--    1 root     root            16 Sep  2 17:46 reg
-r--r--r--    1 root     root             4 Sep  2 17:46 sram
-r--r--r--    1 root     root             5 Sep  2 17:46 status

mhm, after rebuilding and flashing i get a trace when bootup process tries to bring up wan…really strange…seems like something has changed…still do not see the sfp property on mac@1 in any dts{,i,o}

ah, it looks like i miss the phy driver/firmware in my current state…maybe i had it enabled manually

Symbol: PACKAGE_mt7988-2p5g-phy-firmware [=n] 
Symbol: PACKAGE_kmod-phy-mediatek-2p5g [=n]

wonder why this happened because i have it enabled…maybe because switching between 4e and 8x board without distclean

define Device/bananapi_bpi-r4-pro-4e
  DEVICE_MODEL := BPi-R4 Pro 4E
  DEVICE_DTS := mt7988a-bananapi-bpi-r4-pro-4e
  DEVICE_DTS_CONFIG := config-mt7988a-bananapi-bpi-r4-pro-4e
  DEVICE_BL2 := comb
  $(call Device/bananapi_bpi-r4-pro-common)
  DEVICE_PACKAGES += mt7988-2p5g-phy-firmware
  DEVICE_DTS_OVERLAY += mt7988a-bananapi-bpi-r4-pro-4e-wan-phy mt7988a-bananapi-bpi-r4-pro-4e-wan-sfp
endef
TARGET_DEVICES += bananapi_bpi-r4-pro-4e

looks better now

[   21.599531] mtk_soc_eth 15100000.ethernet wan: PHY [mdio-bus:0f] driver [MediaTek MT7988 2.5GbE PHY] (irq=POLL)
[   21.609674] mtk_soc_eth 15100000.ethernet wan: configuring for phy/internal link mode

vs.

[   18.519501] mtk_soc_eth 15100000.ethernet wan: PHY [mdio-bus:0f] driver [Generic Clause 45 PHY] (irq=POLL)
[   18.529238] mtk_soc_eth 15100000.ethernet wan: configuring for phy/internal link mode
[   18.537093] ------------[ cut here ]------------
[   18.541730] _phy_start_aneg+0x0/0xa0: returned: -22
[   18.546701] WARNING: CPU: 0 PID: 93 at _phy_state_machine+0x100/0x3e0
[   18.553142] Modules linked in: pppoe ppp_async nft_flow_offload nft_fib_inet nf_flow_table_inet nf_flow_table pppox ppp_generic nft_reject_ipv6 nft_reject_ipv4 nft_reject_inet nft_reject nft_redir nft_quota nft
[   18.629306] CPU: 0 UID: 0 PID: 93 Comm: kworker/u16:3 Tainted: G           O        6.18.44 #0 NONE 
[   18.638430] Tainted: [O]=OOT_MODULE
[   18.641908] Hardware name: Bananapi BPI-R4 Pro 4E (DT)
[   18.647034] Workqueue: events_power_efficient phy_state_machine
[   18.652945] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[   18.659895] pc : _phy_state_machine+0x100/0x3e0
[   18.664414] lr : _phy_state_machine+0x100/0x3e0
...

already noticed, that the device-specific defaults are not taken when selecting another board (here R4pro 8x vs. 4e), not sure how to solve without distclean and rebuilding .config

but back to the retransmitts…i have them only in sending direction and less count than you

root@OpenWrt:~# iperf3 -c 192.168.0.21
Connecting to host 192.168.0.21, port 5201
[  5] local 192.168.0.102 port 59954 connected to 192.168.0.21 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   114 MBytes   952 Mbits/sec    0    656 KBytes       
[  5]   1.00-2.00   sec   113 MBytes   945 Mbits/sec    5    361 KBytes       
[  5]   2.00-3.00   sec   112 MBytes   943 Mbits/sec    2    298 KBytes       
[  5]   3.00-4.00   sec   112 MBytes   942 Mbits/sec    0    506 KBytes       
[  5]   4.00-5.00   sec   112 MBytes   940 Mbits/sec    4    294 KBytes       
[  5]   5.00-6.00   sec   112 MBytes   937 Mbits/sec    1    345 KBytes       
[  5]   6.00-7.00   sec   112 MBytes   942 Mbits/sec    0    529 KBytes       
[  5]   7.00-8.00   sec   112 MBytes   943 Mbits/sec    4    379 KBytes       
[  5]   8.00-9.00   sec   112 MBytes   943 Mbits/sec    5    303 KBytes       
[  5]   9.00-10.00  sec   112 MBytes   941 Mbits/sec    0    477 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.10 GBytes   943 Mbits/sec   21            sender
[  5]   0.00-10.00  sec  1.10 GBytes   941 Mbits/sec                  receiver

iperf Done.
root@OpenWrt:~# iperf3 -R -c 192.168.0.21
Connecting to host 192.168.0.21, port 5201
Reverse mode, remote host 192.168.0.21 is sending
[  5] local 192.168.0.102 port 57768 connected to 192.168.0.21 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec   112 MBytes   939 Mbits/sec                  
[  5]   1.00-2.00   sec   112 MBytes   940 Mbits/sec                  
[  5]   2.00-3.00   sec   112 MBytes   941 Mbits/sec                  
[  5]   3.00-4.00   sec   112 MBytes   938 Mbits/sec                  
[  5]   4.00-5.00   sec   112 MBytes   938 Mbits/sec                  
[  5]   5.00-6.00   sec   112 MBytes   940 Mbits/sec                  
[  5]   6.00-7.00   sec   112 MBytes   940 Mbits/sec                  
[  5]   7.00-8.00   sec   112 MBytes   940 Mbits/sec                  
[  5]   8.00-9.00   sec   112 MBytes   940 Mbits/sec                  
[  5]   9.00-10.00  sec   112 MBytes   940 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.10 GBytes   941 Mbits/sec    0            sender
[  5]   0.00-10.00  sec  1.09 GBytes   939 Mbits/sec                  receiver

iperf Done.

root@OpenWrt:~# ethtool -S wan
NIC statistics:
     tx_bytes: 1234654529
     tx_packets: 858180
     tx_skip: 0
     tx_collisions: 0
     rx_bytes: 1230219181
     rx_packets: 837928
     rx_overflow: 0
     rx_fcs_errors: 0
     rx_short_errors: 0
     rx_long_errors: 0
     rx_checksum_errors: 0
     rx_flow_control_packets: 0
     rx_xdp_redirect: 0
     rx_xdp_pass: 0
     rx_xdp_drop: 0
     rx_xdp_tx: 0
     rx_xdp_tx_errors: 0
     tx_xdp_xmit: 0
     tx_xdp_xmit_errors: 0

maybe caused by client/switch between client and server, or something must settle a bit…did a bidir after the first run which is completely clean (could be lower layer too - tcp window, MTU path discovery or such)

root@OpenWrt:~# iperf3 --bidir -c 192.168.0.21
Connecting to host 192.168.0.21, port 5201
[  5] local 192.168.0.102 port 52736 connected to 192.168.0.21 port 5201
[  7] local 192.168.0.102 port 52752 connected to 192.168.0.21 port 5201
[ ID][Role] Interval           Transfer     Bitrate         Retr  Cwnd
[  5][TX-C]   0.00-1.00   sec   113 MBytes   944 Mbits/sec    0    731 KBytes       
[  7][RX-C]   0.00-1.00   sec   112 MBytes   935 Mbits/sec                  
[  5][TX-C]   1.00-2.00   sec   111 MBytes   929 Mbits/sec    0    771 KBytes       
[  7][RX-C]   1.00-2.00   sec   112 MBytes   935 Mbits/sec                  
[  5][TX-C]   2.00-3.00   sec   112 MBytes   938 Mbits/sec    0    771 KBytes       
[  7][RX-C]   2.00-3.00   sec   112 MBytes   935 Mbits/sec                  
[  5][TX-C]   3.00-4.00   sec   111 MBytes   930 Mbits/sec    0    771 KBytes       
[  7][RX-C]   3.00-4.00   sec   112 MBytes   935 Mbits/sec                  
[  5][TX-C]   4.00-5.00   sec   111 MBytes   929 Mbits/sec    0    771 KBytes       
[  7][RX-C]   4.00-5.00   sec   112 MBytes   935 Mbits/sec                  
[  5][TX-C]   5.00-6.00   sec   111 MBytes   934 Mbits/sec    0    771 KBytes       
[  7][RX-C]   5.00-6.00   sec   112 MBytes   935 Mbits/sec                  
[  5][TX-C]   6.00-7.00   sec   111 MBytes   930 Mbits/sec    0    771 KBytes       
[  7][RX-C]   6.00-7.00   sec   112 MBytes   937 Mbits/sec                  
[  5][TX-C]   7.00-8.00   sec   111 MBytes   933 Mbits/sec    0    771 KBytes       
[  7][RX-C]   7.00-8.00   sec   112 MBytes   935 Mbits/sec                  
[  5][TX-C]   8.00-9.00   sec   111 MBytes   932 Mbits/sec    0    771 KBytes       
[  7][RX-C]   8.00-9.00   sec   112 MBytes   936 Mbits/sec                  
[  5][TX-C]   9.00-10.00  sec   111 MBytes   934 Mbits/sec    0    771 KBytes       
[  7][RX-C]   9.00-10.00  sec   112 MBytes   937 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID][Role] Interval           Transfer     Bitrate         Retr
[  5][TX-C]   0.00-10.00  sec  1.09 GBytes   933 Mbits/sec    0            sender
[  5][TX-C]   0.00-10.00  sec  1.09 GBytes   932 Mbits/sec                  receiver
[  7][RX-C]   0.00-10.00  sec  1.09 GBytes   939 Mbits/sec    0            sender
[  7][RX-C]   0.00-10.00  sec  1.09 GBytes   936 Mbits/sec                  receiver

iperf Done.

Have you used same cable,client,switchports for sfp and phy test? Could be pause/flowcontrol-setting on the way

1 Like

Just to clarify: in my previous test on wan-phy, I had 0 retransmits across all runs in both directions (Retr: 0 on TX and -R RX).

Regarding my physical setup:

  • Cable: The exact same cable was used for both tests.
  • Topology / Switch: BPI-R4 was connected through a 5-port 1 Gbps switch to the main router (AX6000 at 192.168.31.1).
  • Ports: The port on the main router (AX6000) remained unchanged throughout the tests.

AI think:

In your case, rx_flow_control_packets: 0 in ethtool points to disabled Pause frames. On a direct link or small switch buffers, microbursts easily cause buffer overruns during unidirectional TX, forcing TCP Cwnd to collapse (from 656 KB down to ~294 KB). In --bidir mode, incoming ACK pacing naturally smooths out the traffic bursts, which kept your Cwnd stable at 771 KB with zero drops.

UPD2:

@frank-w

I Checked Flow Control on wan interface with AI:

  • Autonegotiate: on
  • RX negotiated: on / TX negotiated: on
  • rx_overflow: 0
  • rx_flow_control_packets: 0

In my setup, symmetric Pause frame negotiation succeeded with the intermediate switch. The absence of rx_overflow and 0 retransmits even under --bidir confirms the MT7988 PHY/MAC handles full-duplex line rate gracefully when Flow Control auto-negotiation is properly resolved by the link partner.

root@BPI:~# iperf3 -c 192.168.31.1 --bidir

Connecting to host 192.168.31.1, port 5201
[  5] local 192.168.31.112 port 55670 connected to 192.168.31.1 port 5201
[  7] local 192.168.31.112 port 55674 connected to 192.168.31.1 port 5201
[ ID][Role] Interval           Transfer     Bitrate         Retr  Cwnd
[  5][TX-C]   0.00-1.00   sec   112 MBytes   941 Mbits/sec    0   1017 KBytes
[  7][RX-C]   0.00-1.00   sec   111 MBytes   931 Mbits/sec
[  5][TX-C]   1.00-2.00   sec   112 MBytes   937 Mbits/sec    0   1017 KBytes
[  7][RX-C]   1.00-2.00   sec   111 MBytes   933 Mbits/sec
[  5][TX-C]   2.00-3.00   sec   111 MBytes   929 Mbits/sec    0   1.13 MBytes
[  7][RX-C]   2.00-3.00   sec   109 MBytes   914 Mbits/sec
[  5][TX-C]   3.00-4.00   sec   110 MBytes   921 Mbits/sec    0   1.22 MBytes
[  7][RX-C]   3.00-4.00   sec   109 MBytes   911 Mbits/sec
[  5][TX-C]   4.00-5.00   sec   111 MBytes   934 Mbits/sec    0   1.22 MBytes
[  7][RX-C]   4.00-5.00   sec   110 MBytes   924 Mbits/sec
[  5][TX-C]   5.00-6.00   sec   112 MBytes   938 Mbits/sec    0   1.22 MBytes
[  7][RX-C]   5.00-6.00   sec   111 MBytes   933 Mbits/sec
[  5][TX-C]   6.00-7.00   sec   112 MBytes   938 Mbits/sec    0   1.28 MBytes
[  7][RX-C]   6.00-7.00   sec   111 MBytes   931 Mbits/sec
[  5][TX-C]   7.00-8.00   sec   112 MBytes   942 Mbits/sec    0   1.28 MBytes
[  7][RX-C]   7.00-8.00   sec   111 MBytes   932 Mbits/sec
[  5][TX-C]   8.00-9.00   sec   112 MBytes   937 Mbits/sec    0   1.28 MBytes
[  7][RX-C]   8.00-9.00   sec   111 MBytes   933 Mbits/sec
[  5][TX-C]   9.00-10.00  sec   112 MBytes   938 Mbits/sec    0   1.28 MBytes
[  7][RX-C]   9.00-10.00  sec   111 MBytes   933 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID][Role] Interval           Transfer     Bitrate         Retr
[  5][TX-C]   0.00-10.00  sec  1.09 GBytes   936 Mbits/sec    0            sender
[  5][TX-C]   0.00-10.01  sec  1.09 GBytes   933 Mbits/sec                  receiver
[  7][RX-C]   0.00-10.00  sec  1.08 GBytes   931 Mbits/sec    0            sender
[  7][RX-C]   0.00-10.01  sec  1.08 GBytes   927 Mbits/sec                  receiver

iperf Done.

root@BPI:~# iperf3 -c 192.168.31.1 -b 930M

Connecting to host 192.168.31.1, port 5201
[  5] local 192.168.31.112 port 42510 connected to 192.168.31.1 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   111 MBytes   930 Mbits/sec    0    496 KBytes
[  5]   1.00-2.00   sec   111 MBytes   929 Mbits/sec    0    496 KBytes
[  5]   2.00-3.00   sec   109 MBytes   913 Mbits/sec    0    496 KBytes
[  5]   3.00-4.00   sec   113 MBytes   947 Mbits/sec    0    588 KBytes
[  5]   4.00-5.00   sec   111 MBytes   930 Mbits/sec    0    588 KBytes
[  5]   5.00-6.00   sec   110 MBytes   924 Mbits/sec    0    699 KBytes
[  5]   6.00-7.00   sec   112 MBytes   936 Mbits/sec    0    699 KBytes
[  5]   7.00-8.00   sec   111 MBytes   930 Mbits/sec    0    699 KBytes
[  5]   8.00-9.00   sec   111 MBytes   930 Mbits/sec    0    699 KBytes
[  5]   9.00-10.00  sec   111 MBytes   930 Mbits/sec    0    775 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.08 GBytes   930 Mbits/sec    0            sender
[  5]   0.00-10.00  sec  1.08 GBytes   930 Mbits/sec                  receiver

iperf Done.

root@BPI:~# ls /sys/class/net/

br-lan   eth2     lan2     lan4     lan6     sfp-lan
eth0     lan1     lan3     lan5     lo       wan

root@BPI:~# ethtool -a wan

Pause parameters for wan:
Autonegotiate:  on
RX:             off
TX:             off
RX negotiated:  on
TX negotiated:  on

root@BPI:~# ethtool -S wan | grep -i flow

     rx_overflow: 0
     rx_flow_control_packets: 0
1 Like

Have 4E board stop flags for merge in openwrt?

Afaik all notes from ai review should be fixed. just a reviewer needs time to look over it

2 Likes

@frank-w Hello! Do you have some new info? I can see in github that it no reactions.

there is none…still waiting for the review

1 Like

Good news: R4PRO 4E support is merged today to upstream openwrt.

4 Likes

GOOD NEWS! Big THX for your work for it! Will be test it more detail the board.

I installed snapshot. In default i have WAN SPF works. I think that PHY ports is default work - more good than SPY in default. Can fix it in next snapshots? Or it mine settings in uboot?

I made it same as 8x to avoid confusion and changing it may break it for sfp users which rely on defaults

Woot! I wonder how long it takes to show up in the TOH? Testing to determine if you are a bot!

and I just realized mine is the 8X. I guess that’s not yet included? Anyways, thanx for your work!

I’m not sure if this wiki is changed manually…i do not see any BPI board there.

8X support was done before so available on firmwareselector too

"available on firmwareselector " Would like to put my 8x into service, but can’t find any bpi-r4 PRO images via selector tool or in releases lists, eg: Index of /releases/24.10.8/targets/mediatek/filogic/ or Index of /releases/25.12.5/targets/mediatek/filogic/ Please point me at something that’s ready to use… TIA.

select snapshots version openwrt in https://firmware-selector.openwrt.org/ I can recomended select Customize installed packages and/or first boot script also In default it will be add “default” software like in stable versions openwrt.