Missing NICs eth2-eth4?


(xbgmsharp) #1

Using the latest Ubuntu image from November, i can only see the first 2 NICs out of 5. Is there a specific kernel module to access the other NICs? The kernel seem to see the NICs.

# dmesg | grep mt7623
[    5.152829] mediatek-mt7623-pinctrl 1000b000.pinctrl: invalid function 1 on pin 77 .
[    7.504957] mt8521p-audio mediatek,mt7623_audio: mt8521p_audio_probe()
[    7.544287] mt7623_wm8960_probe()
[    7.711270] mt7623-wm8960-machine 11220000.sound: spdif-hifi <-> mt8521p-hdmi-rawpcm-out mapping ok
[    7.749358] mt7623-wm8960-machine 11220000.sound: wm8960-hifi <-> mt8521p-i2s1 mapping ok
[   10.548343] mt7623-gsw gswsys@1b100000: mac [0] is fixed link
[   10.554065] mt7623-gsw gswsys@1b100000: mac [1] is fixed link
[   10.559858] mt7623-gsw gswsys@1b100000: Setting MHWTRAP to 0x01017e9f
[   11.162285] mt7623_gsw_config> WLLLL
[   11.681859]   #0: mt7623-wm8960-card
[   13.485591] mt7623-gsw gswsys@1b100000: port 4 link up
[ 1638.034540] mt7623-gsw gswsys@1b100000: port 2 link up
[ 2404.378475] mt7623-gsw gswsys@1b100000: port 3 link up
[ 2413.120548] mt7623-gsw gswsys@1b100000: port 3 link down
[ 2414.703269] mt7623-gsw gswsys@1b100000: port 3 link up
[ 2777.134931] mt7623-gsw gswsys@1b100000: port 2 link down
[ 2785.152855] mt7623-gsw gswsys@1b100000: port 2 link up
[ 3323.662763] mt7623-gsw gswsys@1b100000: port 3 link down
# uname -a
Linux bpi-iot-ros-ai 4.4.70-BPI-R2-Kernel #1 SMP Tue Nov 28 10:59:01 CST 2017 armv7l armv7l armv7l GNU/Linux
# lsb_release -a
LSB Version:	core-9.20160110ubuntu0.2-armhf:core-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-armhf:security-9.20160110ubuntu0.2-noarch
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.2 LTS
Release:	16.04
Codename:	xenial
# ethtool eth2
Settings for eth2:
Cannot get device settings: No such device
Cannot get wake-on-lan settings: No such device
Cannot get message level: No such device
Cannot get link status: No such device
No data available
# ethtool eth3
Settings for eth3:
Cannot get device settings: No such device
Cannot get wake-on-lan settings: No such device
Cannot get message level: No such device
Cannot get link status: No such device
No data available
# ethtool eth4
Settings for eth4:
Cannot get device settings: No such device
Cannot get wake-on-lan settings: No such device
Cannot get message level: No such device
Cannot get link status: No such device
No data available

(Frank W.) #2

you have only 2 NICs (CPU-Lines)

what you want is accessing the PHYs from the switch (mt7530) which is not supported in Kernel 4.4 due to the missing DSA-Driver

you can use my 4.14 Kernel from github to have access to all LAN-Ports in Ubuntu


(xbgmsharp) #3

OK thanks i was trying to access all hardware first from the official ubuntu. I will use your your image. Did you install SSH on your image. I don’t have the UART interface yet to access via the console.


(Frank W.) #4

not an image, only kernel…

copy uImage and modules over your ubuntu-image

note that you must configure your /etc/network/interfaces to get remote-access (eth0-config must be moved to lan0=left LAN-Port) and eth0 must be set to up:

auto eth0
iface eth0 inet manual
  pre-up ip link set $IFACE up
  post-down ip link set $IFACE down

auto lan0
iface lan0 inet static
  hwaddress ether 08:00:00:00:00:00 # if you want to set MAC manually
  address 192.168.0.10
  netmask 255.255.255.0
  gateway 192.168.0.5
  pre-up ip link set $IFACE up
  post-down ip link set $IFACE down

http://www.fw-web.de/dokuwiki/doku.php?id=en/bpi-r2/software#network-configuration


(gary) #5

Below is the diagram of both Switch and CPU MAC, there are only two MAC-s, so we see only two ethernet interfaces(eth0 and eth1) under OS.

Under openwrt(LEDE), we are using DSA, so there are lan0-lan4 and wan interfaces.

image


Clone MAC in LEDE
(Frank W.) #6

dsa-driver in 4.14 sees only 1 NIC (eth0) and all interfaces lan0-4+wan are mapped to it (command “ip a” shows all ports with @eth0)

is that the same in LEDE?

are MAC1 and MAC2 isolated in 7530, so that traffic between lan and wan is never dump switched?


(gary) #7

No, it doen’t in LEDE, lan0-lan3 is under br-lan which is over MAC1, and wan is another which is over MAC2. MAC1 and MAC2 are isolated in switch MT7530.


(Frank W.) #8

can you post output of “ip a” and how your dts/dtsi looks (2 ethernets defined)?

so it looks in 4.14:

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,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 6a:cb:a7:51:2b:c1 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::68cb:a7ff:fe51:2bc1/64 scope link 
       valid_lft forever preferred_lft forever
3: wan@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 6a:cb:a7:51:2b:c1 brd ff:ff:ff:ff:ff:ff
4: lan0@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 08:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.10/24 brd 192.168.0.255 scope global lan0
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:ff:fe00:0/64 scope link 
       valid_lft forever preferred_lft forever
5: lan1@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 6a:cb:a7:51:2b:c1 brd ff:ff:ff:ff:ff:ff
6: lan2@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 6a:cb:a7:51:2b:c1 brd ff:ff:ff:ff:ff:ff
7: lan3@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 6a:cb:a7:51:2b:c1 brd ff:ff:ff:ff:ff:ff
8: wlan1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether f8:62:aa:50:12:1d brd ff:ff:ff:ff:ff:ff


(xbgmsharp) #9

I was testing with the latest Ubuntu image from November on kernel 4.4. I soon will be testing on 4.14.


(xbgmsharp) #10

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: wan@eth0: <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: lan0@eth0: <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: lan1@eth0: <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: lan2@eth0: <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: lan3@eth0: <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


(xbgmsharp) #11

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)

(Frank W.) #12

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)


(gary) #13

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>;

                    port@0 {
                            reg = <0>;
                            label = "wan";
                            cpu = <&cpu_port1>;
                    };

                    port@1 {
                            reg = <1>;
                            label = "lan0";
                            cpu = <&cpu_port0>;
                    };

                    port@2 {
                            reg = <2>;
                            label = "lan1";
                            cpu = <&cpu_port0>;
                    };

                    port@3 {
                            reg = <3>;
                            label = "lan2";
                            cpu = <&cpu_port0>;
                    };

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

                    cpu_port0: port@6 {
                            reg = <6>;
                            label = "cpu";
                            ethernet = <&gmac0>;
                            phy-mode = "trgmii";

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

(dorabmon) #14

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.


(Frank W.) #15

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)?


(dorabmon) #16

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.


(Frank W.) #17

Should be done before…


(Frank W.) #18

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


(xbgmsharp) #19

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.


(Frank W.) #20

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