Strange packet loss

So I tested with kernel 4.19. I must set VLAN because my ISP is offering also IPTV and internet only is on VLAN id 300.

4.19.72-bpi-r2-main

ip link set dev eth1 up:
		ip a:
		eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
		link/ether 02:03:03:03:03:03 brd ff:ff:ff:ff:ff:ff
		inet6 fe80::3:3ff:fe03:303/64 scope link 
		valid_lft forever preferred_lft forever

ip link add link eth1 name wan.300 type vlan id 300:
		journalctl:
		systemd-udevd[743]: ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.
		systemd-udevd[743]: Using default interface naming scheme 'v243'.
		ip a:
		wan.300@eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
		link/ether 02:03:03:03:03:03 brd ff:ff:ff:ff:ff:ff

ip link set dev wan.300 up:
		ip a:
		wan.300@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
		link/ether 02:03:03:03:03:03 brd ff:ff:ff:ff:ff:ff
		inet6 fe80::3:3ff:fe03:303/64 scope link 
		valid_lft forever preferred_lft forever

systemctl start [email protected]:
		journalctl:
		dhclient[811]: Internet Systems Consortium DHCP Client 4.4.1
		dhclient[811]: Internet Systems Consortium DHCP Client 4.4.1
		dhclient[811]: Copyright 2004-2018 Internet Systems Consortium.
		dhclient[811]: All rights reserved.
		dhclient[811]: For info, please visit https://www.isc.org/software/dhcp/
		dhclient[811]: Copyright 2004-2018 Internet Systems Consortium.
		dhclient[811]: All rights reserved.
		dhclient[811]: For info, please visit https://www.isc.org/software/dhcp/
		dhclient[811]: 
		dhclient[811]: Listening on LPF/wan.300/02:03:03:03:03:03
		dhclient[811]: Sending on   LPF/wan.300/02:03:03:03:03:03
		dhclient[811]: Listening on LPF/wan.300/02:03:03:03:03:03
		dhclient[811]: Sending on   LPF/wan.300/02:03:03:03:03:03
		dhclient[811]: Sending on   Socket/fallback
		dhclient[811]: DHCPDISCOVER on wan.300 to 255.255.255.255 port 67 interval 3
		dhclient[811]: Sending on   Socket/fallback
		dhclient[811]: DHCPDISCOVER on wan.300 to 255.255.255.255 port 67 interval 3
		dhclient[811]: DHCPDISCOVER on wan.300 to 255.255.255.255 port 67 interval 3
		dhclient[811]: DHCPDISCOVER on wan.300 to 255.255.255.255 port 67 interval 3
		dhclient[811]: DHCPDISCOVER on wan.300 to 255.255.255.255 port 67 interval 3
		dhclient[811]: DHCPDISCOVER on wan.300 to 255.255.255.255 port 67 interval 3
		dhclient[811]: DHCPDISCOVER on wan.300 to 255.255.255.255 port 67 interval 8
		dhclient[811]: DHCPDISCOVER on wan.300 to 255.255.255.255 port 67 interval 8
		dhclient[811]: DHCPDISCOVER on wan.300 to 255.255.255.255 port 67 interval 15
		dhclient[811]: DHCPDISCOVER on wan.300 to 255.255.255.255 port 67 interval 15
		dhclient[811]: DHCPDISCOVER on wan.300 to 255.255.255.255 port 67 interval 15
		dhclient[811]: DHCPDISCOVER on wan.300 to 255.255.255.255 port 67 interval 15
		dhclient[811]: DHCPDISCOVER on wan.300 to 255.255.255.255 port 67 interval 14
		dhclient[811]: DHCPDISCOVER on wan.300 to 255.255.255.255 port 67 interval 14
		dhclient[811]: No DHCPOFFERS received.
		dhclient[811]: No DHCPOFFERS received.
		dhclient[811]: No working leases in persistent database - sleeping.
		dhclient[811]: No working leases in persistent database - sleeping.

This configuration is working on 4.4 and 4.14. Next is to test without second gmac.
I will use 4.19-without2ndgmac but I must compile it first. I will give you know.

Regards.

maybe you need to change mac? my isp needs different mac-adresses for all vlan.

the journalctl-message are strange:

systemd-udevd[743]: ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.

i guess duplex/speed is only available for physical port (wan) and not for vlan, because there is only a tagging by software, but strange, that this message appears on virtual port. have you put wan up before setting vlan up?

I tried it already and not helps. On kernel 4.14 MAC addresses are same also I have same errors form systemd-udevd but I get IP address so i really don’t understand the problem. I tried with this commands order:
eth1 up -> wan up -> vlan 300 -> dhclient
no success :frowning:

only diffrerence what I see is that on 4.14 kernel I have wan.300@wan but on 4.19 I have wan.300@eth1.

Oh…it should be wan.300@wan…you cannot define vlan on gmacs…something is wrong there

if i add a vlan in kernel 4.19 it looks right (as in 4.14)

ip link add link wan name wan.140 type vlan id 140
root@bpi-r2:~# ip link show wan.140                                             
10: wan.140@wan: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAU
LT group default qlen 1000                                                      
    link/ether 02:03:03:03:03:03 brd ff:ff:ff:ff:ff:ff

you have created it the wrong way:

ip link add link eth1 name wan.300 type vlan id 300 #see eth1

i wonder why this is working in 4.14…it’s basicly wrong…you create a vlan on gmac instead of the dsa-port

I just checked 5.3.0-rc1-bpi-r2-phylink-2.5 and it works fine but i had some problems (I can’t bridge lan interfaces - kernel panic when cable plugged in)

I can use git now and cloudflared. As I could not use cloudlfared before, on 4.14, I switched to dnscrypt-proxy. On 4.14 had lot of timeouts when daemon was looking for servers. Now on 5.3 I have no timeouts at all - all server are avaliable.
I’m going back to 4.19 and do vlan as you mentioned above.

rc1 has the bridging-error that was fixed in rc4 afaik…

Unfortunately is not working.
I have wan.300@wan but still no ip address from my isp.

I’ll try patched 5.3.
fatal: bad object 17494d3884cd0c5cf8367ae6e8219e00fa53983c

:frowning:

“net: dsa: Check existence of .port_mdb_add callback before calling it” is now 58799865be84e2a895dab72de0e1b996ed943f22

have now updated 5.3 to release (5.3.0) and renamed branch to 5.3-main

1 Like

I used 5.3-main and have now same problem like on 4.19: my isp is not giving me ip address.
Changing mac address is not helping.

you can try 5.4-rc now, it contains phylink-patches and will be next lts

i expect problems caused by wrong mt7530- setup in older mainline-driver

1 Like

Still the same :frowning:
I get ip address from my isp without problems only on 4.4 and 4.14.

I thought 5.3-phylink was working…So 5.4 should work too

Yes 5.3.0-rc1-bpi-r2-phylink-2.5 was working,
but 5.3-main and above just stopped working. I don’t understand this :frowning:

Mhm maybe 5.3-phylink has routed wan over gmac2…will add patches tomorrow

1 Like

have added second gmac-patches here: https://github.com/frank-w/BPI-R2-4.14/tree/5.4-gmac

But have not yet tested it due to missing time…

have now tried 5.4-gmac-branch and run dhclient on both gmacs (wan+lan2)

both are working and giving good traffic (lan2=940Mbit/s,wan~915-940Mbit/s) with iperf3 without retransmitts

Zusammenfassung
root@bpi-r2:~# ip link set wan up
[ 433.276386] mtk_soc_eth 1b100000.ethernet wan: PHY [mdio-bus:00] driver [Generic PHY]
[ 433.284343] mtk_soc_eth 1b100000.ethernet wan: configuring for phy/rgmii link mode
root@bpi-r2:~# [ 437.448610] mtk_soc_eth 1b100000.ethernet wan: Link is Up - 1Gbps/Full - flow control off
[ 437.456820] IPv6: ADDRCONF(NETDEV_CHANGE): wan: link becomes ready

root@bpi-r2:~#
root@bpi-r2:~#
root@bpi-r2:~# 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,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 62:16:69:7e:d6:fc brd ff:ff:ff:ff:ff:ff
inet6 fe80::6016:69ff:fe7e:d6fc/64 scope link
valid_lft forever preferred_lft forever
3: wan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 5a:8b:a4:e6:11:dc brd ff:ff:ff:ff:ff:ff
inet6 fe80::588b:a4ff:fee6:11dc/64 scope link
valid_lft forever preferred_lft forever
4: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
link/sit 0.0.0.0 brd 0.0.0.0
5: lan0@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
link/ether 08:00:00:00:00:01 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.11/24 brd 192.168.0.255 scope global lan0
valid_lft forever preferred_lft forever
inet6 fe80::a00:ff:fe00:1/64 scope link
valid_lft forever preferred_lft forever
6: lan1@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 62:16:69:7e:d6:fc brd ff:ff:ff:ff:ff:ff
7: lan2@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 62:16:69:7e:d6:fc brd ff:ff:ff:ff:ff:ff
8: lan3@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 62:16:69:7e:d6:fc brd ff:ff:ff:ff:ff:ff
root@bpi-r2:~# ip add del 192.168.0.11/24 dev lan0
root@bpi-r2:~# dhclient wan
root@bpi-r2:~# ip addr show wan
3: wan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 5a:8b:a4:e6:11:dc brd ff:ff:ff:ff:ff:ff
inet 192.168.0.105/24 brd 192.168.0.255 scope global dynamic wan
valid_lft 172791sec preferred_lft 172791sec
inet6 fe80::588b:a4ff:fee6:11dc/64 scope link
valid_lft forever preferred_lft forever
root@bpi-r2:~#

made same for lan2 (to use the other gmac)...also works in my test, only see a strange vlan-message on bringing up

root@bpi-r2:~# ip link set lan2 up
[ 594.156547] mt7530 mdio-bus:1f lan2: configuring for phy/gmii link mode
[ 594.163658] 8021q: adding VLAN 0 to HW filter on device lan2
root@bpi-r2:~# [ 598.328964] mt7530 mdio-bus:1f lan2: Link is Up - 1Gbps/Full - flow control off
[ 598.336307] IPv6: ADDRCONF(NETDEV_CHANGE): lan2: link becomes ready

root@bpi-r2:~#
root@bpi-r2:~# ip addr show lan2
7: lan2@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 62:16:69:7e:d6:fc brd ff:ff:ff:ff:ff:ff
inet6 fe80::6016:69ff:fe7e:d6fc/64 scope link
valid_lft forever preferred_lft forever
root@bpi-r2:~# dhclient lan2
root@bpi-r2:~# ip addr show lan2
7: lan2@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 62:16:69:7e:d6:fc brd ff:ff:ff:ff:ff:ff
inet 192.168.0.118/24 brd 192.168.0.255 scope global dynamic lan2
valid_lft 172798sec preferred_lft 172798sec
inet6 fe80::6016:69ff:fe7e:d6fc/64 scope link
valid_lft forever preferred_lft forever
1 Like

Yes! Everything is working fine. Cloudflare is running, dnscrypt-proxy have all servers avaliable and I can use git.

Thank you @frank-w! :grinning:

Best regards.

as far as we know now, trgmii seems to be broken for gmac1, after setting to rgmii or moving wan to the rgmii-configured gmac2 it’s reported to be fixed…

@bialy39 can you please try this branch?

maybe change trgmii to rgmii in older kernel-versions without phylink (i guess the problem is also there, and rene took some values from the existing code)

Could you try latest openwrt-snapshot?

http://downloads.openwrt.org/snapshots/targets/mediatek/mt7623/

Mhm…it is still 4.14 and should work like my 4.14 if dql-patch is dropped…