Other Parts Discussed in Thread: SK-AM64B, SK-AM62B, TMDS64EVM
Tool/software:
Hi,
In our design we are using AM6412 with DP83867 Phy. Our product has two ethernet interfaces eth0 and eth1.
We are using kernel version 6.1.80-rt26.
When we have PTP running on eth1 (and synced), if we change the link state of eth0 interface, the ptp sync on eth1 interface will be lost and never recovers.
To restore the sync we need to perform any of the following activities
1. Restart the PTP
2. Run "ifconfig eth1 up" (Please note it is eth1, the interface which was already up and had PTP sync working)
3. Turn on Promiscuous mode "ip link set eth1 promisc on"
Further debugging revels that the issue is somehow related to ALE functionality. When the PTP sync is lost we see that following two counters are incremented
ale_drop: 37378
rx_port_mask_drop: 37378
Some other observations:
1. Sync is lost when the other interface is brought down or up (i.e. any change in state)
2. Sync is not restored even when the other interface is set to the original state when PTP was working.
3. This example show PTP running on eth1 and change of the state of eth0, same behavior is observed when the interfaces are interchanged.
Please find below logs form ptp4l application with annotations
$./ptp4l -2 -P -H -i eth1 -m -q -l 7
..
.. <<<<<<< output stripped
..
ptp4l[17109.394]: port 1 (eth1): delay timeout
ptp4l[17109.395]: delay filtered 1316 raw 1330
ptp4l[17110.087]: master offset 25 s2 freq -26011 path delay 1316
ptp4l[17110.394]: port 1 (eth1): delay timeout
ptp4l[17110.395]: delay filtered 1316 raw 1310
ptp4l[17111.088]: master offset 16 s2 freq -26012 path delay 1316
ptp4l[17111.395]: port 1 (eth1): delay timeout
ptp4l[17111.395]: delay filtered 1312 raw 1311
ptp4l[17111.823]: port 1 (eth1): received link status notification
[17111.824549] am65-cpsw-nuss 8000000.ethernet eth0) <<< ETH0 state is changed here, note that PTP is running on ETH1.
[17111.824577] am65-cpsw-nuss 8000000.ethernet eth0: configuring for phy/rgmii-rxid link mode
[17111.833218] 8021q: adding VLAN 0 to HW filter on device eth0
ptp4l[17112.395]: port 1 (eth1): delay timeout
ptp4l[17113.395]: port 1 (eth1): delay timeout
ptp4l[17114.396]: port 1 (eth1): delay timeout
ptp4l[17114.877]: port 1 (eth1): received link status notificati[17114.879496] am65-cpsw-nuss 8000000.ethernet eth0f
on
ptp4l[17115.396]: port 1 (eth1): delay timeout
ptp4l[17116.396]: port 1 (eth1): delay timeout
ptp4l[17117.396]: port 1 (eth1): delay timeout
ptp4l[17117.454]: port 1 (eth1): announce timeout <<< PTP sync is lost as the multicast packets are dropped by interface
ptp4l[17117.454]: port 1 (eth1): SLAVE to LISTENING on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES
ptp4l[17117.454]: selected local clock 543b30.fffe.0118ef as best master
ptp4l[17118.454]: port 1 (eth1): delay timeout
ptp4l[17119.454]: port 1 (eth1): delay timeout
ptp4l[17120.455]: port 1 (eth1): delay timeout
ptp4l[17121.455]: port 1 (eth1): delay timeout
ptp4l[17122.455]: port 1 (eth1): delay timeout
ptp4l[17123.456]: port 1 (eth1): delay timeout
ptp4l[17124.249]: port 1 (eth1): announce timeout
ptp4l[17124.456]: port 1 (eth1): delay timeout
ptp4l[17125.456]: port 1 (eth1): delay timeout
ptp4l[17126.456]: port 1 (eth1): delay timeout
ptp4l[17127.457]: port 1 (eth1): delay timeout
ptp4l[17128.457]: port 1 (eth1): delay timeout
..
.. <<<<<<< output stripped
..
ptp4l[5620.609]: port 1 (eth1): master sync timeout
ptp4l[5620.845]: port 1 (eth1): delay timeout
[ 5621.584634] device eth1 entered promiscuous mode <<< eth1 entered promiscuous mode
ptp4l[5621.586]: port 1 (eth1): ignoring message
ptp4l[5621.609]: port 1 (eth1): master sync timeout
ptp4l[5621.610]: port 1 (eth1): master tx announce timeout
ptp4l[5621.846]: port 1 (eth1): delay timeout
ptp4l[5621.846]: delay filtered 1295 raw 1306
ptp4l[5622.610]: port 1 (eth1): master sync timeout
ptp4l[5622.846]: port 1 (eth1): delay timeout
ptp4l[5622.847]: delay filtered 1299 raw 1304
ptp4l[5623.610]: port 1 (eth1): master sync timeout
ptp4l[5623.611]: port 1 (eth1): master tx announce timeout
ptp4l[5623.846]: port 1 (eth1): delay timeout
ptp4l[5623.847]: delay filtered 1304 raw 1312
ptp4l[5624.610]: port 1 (eth1): master sync timeout
ptp4l[5624.664]: selected best master clock 40a6b7.fffe.9c2706 <<< PTP is synced again