Missing NICs eth2-eth4?

on 4.14, internal wifi ap0. All NIC down

# uname -a
Linux bpi-r2 4.14.11-00039-ga352d6b52e30 #2 SMP Thu Jan 4 11:27:02 EST 2018 armv7l GNU/Linux
# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 4a:93:ae:dc:99:04 brd ff:ff:ff:ff:ff:ff
3: [email protected]: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 4a:93:ae:dc:99:04 brd ff:ff:ff:ff:ff:ff
4: [email protected]: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 4a:93:ae:dc:99:04 brd ff:ff:ff:ff:ff:ff
5: [email protected]: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 4a:93:ae:dc:99:04 brd ff:ff:ff:ff:ff:ff
6: [email protected]: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 4a:93:ae:dc:99:04 brd ff:ff:ff:ff:ff:ff
7: [email protected]: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 4a:93:ae:dc:99:04 brd ff:ff:ff:ff:ff:ff
8: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 00:08:22:04:4c:00 brd ff:ff:ff:ff:ff:ff
9: ap0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 02:08:22:04:4c:00 brd ff:ff:ff:ff:ff:ff

So you have to make up all interface starting with eth0, then lanX

ip link set lanX up

When trying to add vlan Ignore

# vconfig add wlan0 6
Added VLAN with VID == 6 to IF -:wlan0:-
nl80211: Ignore RTM_NEWLINK event for foreign ifindex 11
nl80211: Ignore RTM_NEWLINK event for foreign ifindex 9
VLAN: RTM_NEWLINK: ifi_index=11 ifname=wlan0.6 ifi_family=0 ifi_flags=0x1002 ()
VLAN: vlan_newlink(wlan0.6)
VLAN: RTM_NEWLINK: ifi_index=9 ifname=wlan0 ifi_family=0 ifi_flags=0x1002 ()
VLAN: vlan_newlink(wlan0)

first ethx,then lanx described here with ip-address-configuration: http://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:software#network-configuration

Vlan currently not supported in 4.14 (needs dsa-driver from 4.15)

Below is the dts for DSA.

    switch {
            compatible = "mediatek,mt7530";
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <0>;

            dsa,mii-bus = <&mdio>;
            pinctrl-names = "default";
            reset-gpios = <&pio 33 0>;
            core-supply = <&mt6323_vpa_reg>;
            io-supply = <&mt6323_vemc3v3_reg>;

            ports {
                    #address-cells = <1>;
                    #size-cells = <0>;
                    reg = <0>;

                    [email protected] {
                            reg = <0>;
                            label = "wan";
                            cpu = <&cpu_port1>;
                    };

                    [email protected] {
                            reg = <1>;
                            label = "lan0";
                            cpu = <&cpu_port0>;
                    };

                    [email protected] {
                            reg = <2>;
                            label = "lan1";
                            cpu = <&cpu_port0>;
                    };

                    [email protected] {
                            reg = <3>;
                            label = "lan2";
                            cpu = <&cpu_port0>;
                    };

                    [email protected] {
                            reg = <4>;
                            label = "lan3";
                            cpu = <&cpu_port0>;
                    };
                    cpu_port1: [email protected] {
                            reg = <5>;
                            label = "cpu";
                            ethernet = <&gmac1>;
                            phy-mode = "trgmii";
                            fixed-link {
                                    speed = <1000>;
                                    full-duplex;
                            };
                    };

                    cpu_port0: [email protected] {
                            reg = <6>;
                            label = "cpu";
                            ethernet = <&gmac0>;
                            phy-mode = "trgmii";

                            fixed-link {
                                    speed = <1000>;
                                    full-duplex;
                            };
                    };
            };
1 Like

LEDE for bpi-r2 have some hack in dsa core layer for allowing eth0 mapped into lan0-4, and eth1 mapped into wan. (mutliple cpu port is being utilized).

While it doesn’t do it in upstream because dsa core layer haven’t been able to support more than one cpu port at the current point. So, mt7530 dsa in upstream code still utilize just only one cpu port to follow core’s definition.

But dsa core member is designing and thinking this feature. I believe it should be supported in the near feature.

1 Like

Hi you mean this patch:

I can try to add it…if that gives no error i can try to change dts like gary posted.

@garywang is that the dsi or bpi.dts? Can you attach the full files (if i need additional part)?

yes, it is one of the necessary patches for changing dsa into enabling dual-mac support on MT7530.

but, it needs another one patch to hack the dsa core to permit the mt7530 enables two cpu ports.

Should be done before…

second patch (0033) have many hunks failed

patch -p1 --dry-run < ../0033-net-dsa-add-multi-gmac-support.patch 
checking file drivers/net/dsa/mt7530.c
Hunk #1 succeeded at 908 with fuzz 1 (offset -88 lines).
checking file include/net/dsa.h
Hunk #1 FAILED at 145.
Hunk #2 FAILED at 205.
Hunk #3 succeeded at 266 with fuzz 1 (offset 48 lines).
Hunk #4 FAILED at 239.
3 out of 4 hunks FAILED
checking file net/dsa/dsa2.c
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
4 out of 4 hunks ignored
checking file net/dsa/dsa_priv.h
Hunk #1 FAILED at 43.
1 out of 1 hunk FAILED
checking file net/dsa/slave.c
Hunk #1 FAILED at 61.
Hunk #2 FAILED at 96.
Hunk #3 FAILED at 151.
Hunk #4 FAILED at 178.
Hunk #5 FAILED at 189.
Hunk #6 FAILED at 198.
Hunk #7 FAILED at 633.
Hunk #8 FAILED at 945.
Hunk #9 FAILED at 1233.
Hunk #10 succeeded at 1295 with fuzz 2 (offset 32 lines).
9 out of 10 hunks FAILED

https://github.com/frank-w/BPI-R2-4.14/tree/GMAC2

On 4.1.4, for some reason i can’t get 1000Mbps/Full?

[   10.562987] mt7530 mdio-bus:00 lan3: Link is Up - 100Mbps/Full - flow control rx/tx
[   11.522700] mt7530 mdio-bus:00 lan0: Link is Up - 10Mbps/Half - flow control off
[ 3378.082974] mt7530 mdio-bus:00 lan2: Link is Up - 100Mbps/Full - flow control off

Will check on 4.4 on reboot.

my net is recognized as 1Gb/s

[   12.400201] mt7530 mdio-bus:00 lan0: Link is Up - 1Gbps/Full - flow control off

seems your network-equipment does not support/configured for GB-ethernet

my network support 1Gbps/Full. it is funny the main NIC is 1G but not the lan NIC whic are detected in 10/Full and 100/Full.

# ethtool eth0
Settings for eth0:
	Supported ports: [ TP MII ]
	Supported link modes:   1000baseT/Half 1000baseT/Full 
	Supported pause frame use: Symmetric Receive-only
	Supports auto-negotiation: Yes
	Advertised link modes:  1000baseT/Half 1000baseT/Full 
	Advertised pause frame use: Symmetric Receive-only
	Advertised auto-negotiation: Yes
	Link partner advertised link modes:  1000baseT/Full 
	Link partner advertised pause frame use: Symmetric
	Link partner advertised auto-negotiation: No
	Speed: 1000Mb/s
	Duplex: Full
	Port: MII
	PHYAD: 0
	Transceiver: internal
	Auto-negotiation: on
	Current message level: 0x000000ff (255)
			       drv probe link timer ifdown ifup rx_err tx_err
	Link detected: yes

lan0

# # ethtool lan0
Settings for lan0:
	Supported ports: [ TP AUI BNC MII FIBRE ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Supported pause frame use: Symmetric Receive-only
	Supports auto-negotiation: Yes
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Advertised pause frame use: No
	Advertised auto-negotiation: Yes
	Link partner advertised link modes:  10baseT/Half 
	Link partner advertised pause frame use: No
	Link partner advertised auto-negotiation: No
	Speed: 10Mb/s
	Duplex: Half
	Port: MII
	PHYAD: 1
	Transceiver: internal
	Auto-negotiation: on
	Supports Wake-on: d
	Wake-on: d
	Link detected: yes

lan3

# ethtool lan3
Settings for lan3:
	Supported ports: [ TP AUI BNC MII FIBRE ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Supported pause frame use: Symmetric Receive-only
	Supports auto-negotiation: Yes
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Advertised pause frame use: No
	Advertised auto-negotiation: Yes
	Link partner advertised link modes:  10baseT/Half 10baseT/Full 
	                                     100baseT/Half 100baseT/Full 
	Link partner advertised pause frame use: Symmetric
	Link partner advertised auto-negotiation: Yes
	Speed: 100Mb/s
	Duplex: Full
	Port: MII
	PHYAD: 4
	Transceiver: internal
	Auto-negotiation: on
	Supports Wake-on: d
	Wake-on: d
	Link detected: yes

eth0 (=cpu-port) is afaik fixed to 1GBs in dts(i)

lan0-4 have variable bandwidth (Auto-Neg/OS-Setting), you see in your ethtool, that 1G is also supported:

Supported link modes:   10baseT/Half 10baseT/Full 
                        100baseT/Half 100baseT/Full 
                        1000baseT/Full 
Advertised link modes:  10baseT/Half 10baseT/Full 
                        100baseT/Half 100baseT/Full 
                        1000baseT/Full 

i don’t known why a fallback speed is used, on my switch 1G is used on lan0

as you see

Advertised auto-negotiation: Yes
Link partner advertised link modes:  10baseT/Half 10baseT/Full 
                                     100baseT/Half 100baseT/Full 

your switch on the other end supports only 10/100Mbit (handled over auto-neg) :wink: or maybe cable, etc…

OK will check might be on my side. The good news with your kernel i can see all 5 NICs, so thanks.

it’s not my work…the dsa-support was working before in 4.14…

ok excuse my limited knowledge… whats the link to your 4.14 kernel from github and how exactly do you copy over the old kernel?

first things first i guess where is your github link and ill try to google the how to

You’ll find all info in my wiki

Installation: https://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:kernel#compiled_414x

I mainly use build.sh to copy kernel to sdcard because i can define name of binary in boot and this makes backup of existing kernel.

If you want to use different names you have to make sure that your new kernel gets loaded by set kernel var to name of your Kernel-binary. If you use my last uboot there are multiple kernel-vars and you can define own menu-entries (needs reload bootmenu before they appear).

Github-link is also on this page

Forgive my poor knowledge, the port isolation works for PHY to switch lines and thus all lan-ports are considered to carry information on NIC eth0. If this is true, does the CPU differentiate which lan port is sending the information and how does it do that?

PS- I wish to implement OVS on R2 but the port isolation does not work to parse and redirect traffic from each of the lan ports

Frank,

         I have your buster build and have all of the Ethernet interfaces working out of the box. The wireless connection I can't seem to get it working at all. It isn't represented when doing the "ip a" command. How do I get the wireless up and operational?

Thanks again for all your help!

-Brian-

You have to create ap0-device with wmt-tools. See my wiki or any of the wifi-threads

https://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:wlan#internal

Basicly you need wmt-tools (you’ll find binaries in src-folder - without ext):

config and maybe my wifi.sh

there is a package in my wiki, github releases and my gdrive containing neceasary files