On Tue, Feb 01, 2022 at 07:04:29PM +0000, ramesh t wrote: > Resetting of testUnit is triggering interface A to go down. This in turns is > triggering PHC run at different frequency for small duration till interface > is up. Though this is a driver issue on interface A, my question why is the > below code required? > > interval = (int64_t)ts - cc->last_ts; > > if (interval >= 0 && interval < CHECK_MIN_INTERVAL) > > return ret; > > Can't we just depend on CLOCK_MONOTONIC clock check?
This code is needed to not check timestamps that are too close to each other as that amplifies the noise in the calculated frequency offset between the two clocks and increase rate of false positives. The interval could be calculated from the system monotonic clock, if that's what you are asking. The clock would have to be read in each call of the function instead of just once per the minimum interval. -- Miroslav Lichvar _______________________________________________ Linuxptp-users mailing list Linuxptp-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-users