I think that there are bugs with running ptp4l as a jbod boundary clock +
enabling sanity_freq_limit (clockcheck) at the same time.
Imagine some set of ports each with their own PHC (PTP Hardware Clock).
The basic problem is that on any port, any incoming timestamp packet -
including DelayReq - invokes a clockcheck if sanity_freq_limit is set. But,
there is only one global clock/clockcheck state, so if the PHC time on the
ports are substantially different for some reason, then the timestamps on
the incoming packets could be totally different, triggering spurious
clockcheck errors.
Here is an example situation that's happening to me:
1. phc2sys is started in auto mode (phc2sys -m -q -a -r -r -E linreg)
2. ptp4l starts up. All of the PHCs are set to system time during boot by
the ethernet drivers, or maybe synced by phc2sys. Either way, they're all
approximately the same time.
3. ptp4l decides it's a master on all ports and starts serving time.
4. a new foreign master appears on port 1, ptp4l transitions to
uncalibrated slave on that port.
5. phc2sys pauses waiting for ptp4l to re-stabilize with the new
configuration.
6. the foreign master's time is 60 seconds different from the system/PHC
time, causing ptp4l to step the port 1 PHC to the new time. However -
phc2sys is still paused waiting for ptp4l to stabilize.
7. A DelayReq arrives on port 2 from a slave (remember, ptp4l has been
advertising as master on all other ports)
8. The port 2 DelayReq PHC timestamp is ~60 seconds different from port 1.
This causes a clockcheck error - the previous timestamp and current
timestamp are 60 seconds apart, which is totally skewed from monotonic
time. The clockcheck error causes the servo to be reset.
This loops ~forever, phc2sys stays paused, so port 1, the system time, and
the other ports PHCs never synchronize, so forward progress can never be
made.
If I set sanity_freq_limit to 0 (disabling it), this problem disappears.
I think that maybe clockcheck should have separate state for each PHC.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users