Disable frequency synchronization while using ptp4l

288 Views Asked by At

On my system, i have two CPUs - CPU1 and CPU2 connected with each other using ethernet (phy-less). Each of these cpus have their own PHC (PTP hardware clock). Both of these ptp hardware clock are fed using same external clock. Thus there is no frequency offset between PHC1 and PHC2. CPU1 is connected to gps and hence can get ToD (time of day). The goal is to sync-up the ToD (time of day) in both PHCs. For this, i am running ptp4l with CPU1 as master and CPU2 as slave.

Since i do not need frequency correction, how can I tell ptp4l to do only offset correction and no frequency correction?

Regards Vakul

PS: I have used ptp4l in the above-mentioned setup and noticed that adjfine is still getting called by ptp4l process. This was confirmed by attaching strace with ptp4l process. As both the PHCs are being fed with the same clock source, ideally, there should not be any frequency offset between them. But I still see non-zero frequency offset in ptp4l logs and hence adjfine is getting called.

2

There are 2 best solutions below

0
On

There is no option in ptp4l to only use step adjustments.

However since linuxptp is open-source you could fork the repo, and modify the code to replace the clockadj_set_freq with clockadj_step in the clock.c file. Specifically in the clock_synchronize function. However I cannot vouch for the performance of ptp4l after this modification.

0
On

Ultimately at the PHC level the adjustment is done in time/phase by writing the correction value to time increment. There is no frequency adjustment done to the oscillator. This is as far as Intel NICs are considered