JA76PF2 switch - strange speed reported

Hi,
I have cheap board JA76PF2 - which has two GE ports. On it there is installed OpenWRT 18.06.2 r7676-cddd7b4c77
Here is configuration:

root@xxxx:~# cat /etc/config/network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fde0:b4b4:c302::/48'

config interface 'lan'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option _orig_ifname 'eth1'
        option _orig_bridge 'true'
        option ifname 'eth1'
        option ipaddr '172.17.0.1'
        option force_link '0'

config interface 'wan'
        option _orig_ifname 'eth0'
        option _orig_bridge 'false'
        option ifname 'eth0'
        option proto 'dhcp'

My problem is with interfaces speed. Ethtool reports on both eth and eth1 1000 mbps negotiated.
WAN:

root@xxx:~# ethtool eth0
Settings for eth0:
        Supported ports: [ ]
        Supported link modes:   1000baseT/Full
        Supported pause frame use: No
        Supports auto-negotiation: No
        Supported FEC modes: Not reported
        Advertised link modes:  1000baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 0
        Transceiver: external
        Auto-negotiation: on
        Current message level: 0x000000ff (255)
                               drv probe link timer ifdown ifup rx_err tx_err
        Link detected: yes

LAN:

root@xxx:~# ethtool eth1
Settings for eth1:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supported pause frame use: No
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
                                             1000baseT/Full
        Link partner advertised pause frame use: No
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 4
        Transceiver: external
        Auto-negotiation: on
        Current message level: 0x000000ff (255)
                               drv probe link timer ifdown ifup rx_err tx_err
        Link detected: yes

But swconfig reports 100 mbps for Port 1 where outside traffic goes. So I can't get more then 100mbps speed:

root@xxx:~# swconfig dev switch0 port 1 get link
port:1 link:up speed:100baseT full-duplex auto

switch0 port 1 seems to be bound to WAN (!). Why I assume that?:

root@xxx:~# swconfig dev switch0 get arl_table
address resolution table
Port 0: MAC xx:xx:xx:xx:xx:86
Port 1: MAC xx:xx:xx:xx:xx::14

Mac address of Port 0 is same as my eth0.
Speed of Port 0 is 1000 mbps - the problem is with Port 1 which has a speed of 100 mbps and I thing this is limiting my wget -O /dev/null "http://noc.pirx.pl/500mb.bin" to ~70 mbps

Can someone help me to debug that problem?

Is the cable working properly? You need all 4 pairs of the cat5e (or better) to achieve Gigabit connection. Is the other end supporting gigabit?

1 Like

Yes - it's new CAT6 cable on both (same) and I've swapped them without possitive result.
What is wired for me, that ethtool first was showing 100mbps on eth0 (WAN) interface when I've been using POE. So I removed POE and upgraded cables. Now ethtool reports 1000 mbps on WAN but traffic is limited to 100mbps. I have 150 mbps internet from provider. And when I connect laptop directly to router - it works with 150 mbps. Then when I switch to openwrt router - it is limited.
The strangest thing is that switch is attached to eth0 - WAN interface

Is it possible - that eth0 is lan interface and eth1 is wan? If eth0 has switch attached to it but not all ports are exposed / exists phisically it's hard to determine it. But this interface is POE so maybe it is LAN interface?

The names of interfaces LAN and WAN are just conventional. You can assign any physical interface (e.g eth0), subinterface (e.g eth1.3) or virtual interface (e.g tun0) under them.
So what matters is which port corresponds to each physical interface.
I have not found any hardware diagram of the router to understand how physical ports are connected to the board, but the layout matches a lot to Carambola 2.

It is very likely that your POE is using the 2 pairs of the cat6 cable so you are limited to the speed you can achieve. Check if you can use a 802.3af/at gigabit capable POE.

1 Like

POE is a side topic - main is the speed repoter by ethtool vs swconfig. I'd like to nail it down.

Here is what I see now:
swconfig shows that I have one switch: switch0
So I run swconfig dev switch0 show | less
on arl_table I see two Ports: Port 0 and Port 1
Port 1 sees my WAN Mac address. Port 1 sees provider's bridge address
below I see reports about ports.
Port 0 (so that port where my current WAN interface is) has speed 1000 mbps
Port 1 (where in arl_table I see Mac address of provider's bridge) has speed 100 mbps

Conlcusions:
Provider's bridge - which is a cable router set as bridge - has 100 mbps speed on their side or cable from my device to bridge is corrupted. Replace cable: same result - I've switched cable from my LAN side to WAN side.

Kernel reports (dmesg):

ar71xx: pll_reg 0xb8050010: 0x110000
eth0: link up (1000Mbps/Full duplex)
ar71xx: pll_reg 0xb8050014: 0x110000
eth1: link up (1000Mbps/Full duplex)

For what it's worth on my Carambola 2 router, which has 2x100Mbps links I get these:

Global attributes:
        enable_vlan: 0
        mirror_monitor_port: 15
Port 0:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 0
        link: port:0 link:up speed:1000baseT full-duplex txflow rxflow 
Port 1:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 0
        link: port:1 link:down
Port 2:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 0
        link: port:2 link:up speed:100baseT full-duplex auto
Port 3:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 0
        link: port:3 link:down
Port 4:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 0
        link: port:4 link:down

root@xeli:~# dmesg | grep eth
[    1.633461] eth0: Atheros AG71xx at 0xba000000, irq 5, mode:GMII
[    2.270362] eth1: Atheros AG71xx at 0xb9000000, irq 4, mode:MII
[    7.381151] eth0: link up (1000Mbps/Full duplex)
[   52.011534] eth1: link up (100Mbps/Full duplex)

How on earth did it detect 5 ports and Gigabit speed is beyond me.
So let's forget a bit these things. Do you have a Gigabit switch (even a cheap one) to connect the router directly on it and verify that the switch reports gigabit speed? Or can you connect your PC and see what the network manager will report as speed for this connection?

1 Like

If you believe this, you should still follow @trendy's advice:

Please be advised if the issue is really PoE, this work is futile until that's solved.