Hello,

I am observing a rough difference of 37 seconds between the system clocks
of my master and slave nodes. I would appreciate any help towards debugging
my issue.

The master is an Intel Nuc and the slave is a custom board using Xilinx
Zynq with no hardware PTP support.

Slave:
./ptp4l -i eth0 -m -s -S
Master:
./ptp4l -i eno1 -m

If the systems are locking for the first time, I observe that they sync to
the same clock for a brief amount of time, but then the master's system
clock starts to be ~37 seconds ahead of the slave. However the master
offset reported on slave is still reasonable:

ptp4l[3880.871]: port 1: SLAVE to LISTENING on
ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES
ptp4l[3880.871]: selected local clock 04c3e6.fffe.000000 as best master
ptp4l[3887.365]: selected best master clock 94c691.fffe.ae15ed
ptp4l[3887.365]: port 1: LISTENING to UNCALIBRATED on RS_SLAVE
ptp4l[3889.365]: master offset     -10448 s2 freq  +16110 path delay
27913
ptp4l[3889.365]: port 1: UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED
ptp4l[3890.365]: master offset      -1504 s2 freq  +17003 path delay
27913
ptp4l[3891.365]: master offset     -14047 s2 freq  +15735 path delay
28747
ptp4l[3892.366]: master offset      -6696 s2 freq  +16463 path delay
25854
ptp4l[3893.366]: master offset      -4331 s2 freq  +16695 path delay
25787
ptp4l[3894.366]: master offset      -2601 s2 freq  +16866 path delay
26104
ptp4l[3895.366]: master offset      -8342 s2 freq  +16283 path delay
26421

I did read that HW ptp uses TAI first and SW ptp uses UTC natively, and
that the currentUtcOffset should take care of the leap seconds between
them. I tried using 'utc_offset=0' and 'utc_offset=37' on master side as
well both with similar results.

Additional logs from slave:

sending: GET TIME_PROPERTIES_DATA_SET
04c3e6.fffe.000000-0 seq 0 RESPONSE MANAGEMENT TIME_PROPERTIES_DATA_SET
currentUtcOffset      37
leap61                0
leap59                0
currentUtcOffsetValid 0
ptpTimescale          1
timeTraceable         0
frequencyTraceable    0
timeSource            0xa0
94c691.fffe.ae15ed-1 seq 0 RESPONSE MANAGEMENT TIME_PROPERTIES_DATA_SET
currentUtcOffset      37
leap61                0
leap59                0
currentUtcOffsetValid 0
ptpTimescale          1
timeTraceable         0
frequencyTraceable    0
timeSource            0xa0

sending: GET TIME_STATUS_NP
04c3e6.fffe.000000-0 seq 0 RESPONSE MANAGEMENT TIME_STATUS_NP
master_offset              -361
ingress_time               1562980780442973407
cumulativeScaledRateOffset +0.000000000
scaledLastGmPhaseChange    0
gmTimeBaseIndicator        0
lastGmPhaseChange          0x0000'0000000000000000.0000
gmPresent                  true
gmIdentity                 94c691.fffe.ae15ed
94c691.fffe.ae15ed-1 seq 0 RESPONSE MANAGEMENT TIME_STATUS_NP
master_offset              0
ingress_time               0
cumulativeScaledRateOffset +0.000000000
scaledLastGmPhaseChange    0
gmTimeBaseIndicator        0
lastGmPhaseChange          0x0000'0000000000000000.0000
gmPresent                  false
gmIdentity                 94c691.fffe.ae15ed

When I run the phy2sys on the master as follows, the system time between
the Slave and the Master is always equal to the phc_offset I observe here.
The clock keeps jumping backward indefinitely.

./phc2sys -m -s eno1 -O 37
phc2sys[81.184]: CLOCK_REALTIME phc offset -38862223264 s0 freq      +0
delay   2833
phc2sys[82.185]: CLOCK_REALTIME phc offset -38861531648 s1 freq +691222
delay   2913
phc2sys[83.185]: CLOCK_REALTIME phc offset -38880654316 s2 freq -100000000
delay   2748
phc2sys[84.187]: CLOCK_REALTIME phc offset -38789886462 s2 freq -100000000
delay   3095
phc2sys[85.188]: CLOCK_REALTIME phc offset -38698881070 s2 freq -100000000
delay   2948
phc2sys[86.189]: CLOCK_REALTIME phc offset -38607897757 s2 freq -100000000
delay   3106
phc2sys[87.193]: CLOCK_REALTIME phc offset -38516659264 s2 freq -100000000
delay   3153
phc2sys[88.196]: CLOCK_REALTIME phc offset -38425457191 s2 freq -100000000
delay   3242
phc2sys[89.199]: CLOCK_REALTIME phc offset -38334250233 s2 freq -100000000
delay   3107
phc2sys[90.202]: CLOCK_REALTIME phc offset -38243121259 s2 freq -100000000
delay   3110
phc2sys[91.213]: CLOCK_REALTIME phc offset -38151213835 s2 freq -100000000
delay   3150
phc2sys[92.219]: CLOCK_REALTIME phc offset -38059769484 s2 freq -100000000
delay   3087
phc2sys[93.219]: CLOCK_REALTIME phc offset -37968809472 s2 freq -100000000
delay   3170
phc2sys[94.223]: CLOCK_REALTIME phc offset -37877520977 s2 freq -100000000
delay   3209
phc2sys[95.226]: CLOCK_REALTIME phc offset -37786416330 s2 freq -100000000
delay   3029
phc2sys[96.226]: CLOCK_REALTIME phc offset -37695439258 s2 freq -100000000
delay   3154
phc2sys[97.230]: CLOCK_REALTIME phc offset -37604221158 s2 freq -100000000
delay   3380
phc2sys[98.233]: CLOCK_REALTIME phc offset -37513021663 s2 freq -100000000
delay   3038
phc2sys[99.236]: CLOCK_REALTIME phc offset -37421871247 s2 freq -100000000
delay   3030
phc2sys[100.243]: CLOCK_REALTIME phc offset -37330249895 s2 freq -100000000
delay   3099
phc2sys[101.244]: CLOCK_REALTIME phc offset -37239283064 s2 freq -100000000
delay   3168
phc2sys[102.252]: CLOCK_REALTIME phc offset -37147675994 s2 freq -100000000
delay   3134
phc2sys[103.257]: CLOCK_REALTIME phc offset -37056319690 s2 freq -100000000
delay   3117
phc2sys[104.261]: CLOCK_REALTIME phc offset -36965033694 s2 freq -100000000
delay   3204
phc2sys[105.264]: CLOCK_REALTIME phc offset -36873845498 s2 freq -100000000
delay   3468
phc2sys[106.273]: CLOCK_REALTIME phc offset -36782094695 s2 freq -100000000
delay   3110
phc2sys[107.274]: CLOCK_REALTIME phc offset -36691093237 s2 freq -100000000
delay   3445
phc2sys[108.280]: CLOCK_REALTIME phc offset -36599651176 s2 freq -100000000
delay   3083
phc2sys[109.282]: CLOCK_REALTIME phc offset -36508566184 s2 freq -100000000
delay   3116
phc2sys[110.287]: CLOCK_REALTIME phc offset -36417177248 s2 freq -100000000
delay   3077
phc2sys[111.292]: CLOCK_REALTIME phc offset -36325857098 s2 freq -100000000
delay   3302
phc2sys[112.292]: CLOCK_REALTIME phc offset -36234909947 s2 freq -100000000
delay   3093
phc2sys[113.293]: CLOCK_REALTIME phc offset -36143932209 s2 freq -100000000
delay   3015
phc2sys[114.295]: CLOCK_REALTIME phc offset -36052865754 s2 freq -100000000
delay   3358
phc2sys[115.295]: clockcheck: clock jumped backward or running slower than
expected!
phc2sys[115.295]: CLOCK_REALTIME phc offset -38801050227 s0 freq -100000000
delay   3083
phc2sys[116.298]: CLOCK_REALTIME phc offset -38709870955 s2 freq +91537630
delay   3012
phc2sys[117.298]: CLOCK_REALTIME phc offset -38809396192 s2 freq -100000000
delay   2560
phc2sys[118.302]: CLOCK_REALTIME phc offset -38718601461 s2 freq -100000000
delay   3529
phc2sys[119.310]: CLOCK_REALTIME phc offset -38627002783 s2 freq -100000000
delay   3172
phc2sys[120.313]: CLOCK_REALTIME phc offset -38535812707 s2 freq -100000000
delay   3316
phc2sys[121.314]: CLOCK_REALTIME phc offset -38444788798 s2 freq -100000000
delay   3065
phc2sys[122.315]: CLOCK_REALTIME phc offset -38353850659 s2 freq -100000000
delay   3217
phc2sys[123.328]: CLOCK_REALTIME phc offset -38261748743 s2 freq -100000000
delay   3272
phc2sys[124.340]: CLOCK_REALTIME phc offset -38169718155 s2 freq -100000000
delay   3354
phc2sys[125.344]: CLOCK_REALTIME phc offset -38078426803 s2 freq -100000000
delay   2880
phc2sys[126.354]: CLOCK_REALTIME phc offset -37986599849 s2 freq -100000000
delay   3382
phc2sys[127.364]: CLOCK_REALTIME phc offset -37894827807 s2 freq -100000000
delay   3369
phc2sys[128.371]: CLOCK_REALTIME phc offset -37803304880 s2 freq -100000000
delay   3025
phc2sys[129.374]: CLOCK_REALTIME phc offset -37712072003 s2 freq -100000000
delay   3278
phc2sys[130.375]: CLOCK_REALTIME phc offset -37621101352 s2 freq -100000000
delay   3063
phc2sys[131.381]: CLOCK_REALTIME phc offset -37529600599 s2 freq -100000000
delay   3191
phc2sys[132.404]: CLOCK_REALTIME phc offset -37436626273 s2 freq -100000000
delay   3442
phc2sys[133.417]: CLOCK_REALTIME phc offset -37344555512 s2 freq -100000000
delay   3111
phc2sys[134.428]: CLOCK_REALTIME phc offset -37252609756 s2 freq -100000000
delay   3134
phc2sys[135.440]: CLOCK_REALTIME phc offset -37160634300 s2 freq -100000000
delay   3182
phc2sys[136.449]: CLOCK_REALTIME phc offset -37068904256 s2 freq -100000000
delay   3306
phc2sys[137.459]: CLOCK_REALTIME phc offset -36977091235 s2 freq -100000000
delay   3099
phc2sys[138.466]: CLOCK_REALTIME phc offset -36885592574 s2 freq -100000000
delay   3182
phc2sys[139.471]: CLOCK_REALTIME phc offset -36794194131 s2 freq -100000000
delay   3170
phc2sys[140.476]: CLOCK_REALTIME phc offset -36702867239 s2 freq -100000000
delay   3701
phc2sys[141.476]: CLOCK_REALTIME phc offset -36611889103 s2 freq -100000000
delay   3054
phc2sys[142.477]: CLOCK_REALTIME phc offset -36520955296 s2 freq -100000000
delay   2457
phc2sys[143.477]: CLOCK_REALTIME phc offset -36430028180 s2 freq -100000000
delay   1575
phc2sys[144.477]: CLOCK_REALTIME phc offset -36339053206 s2 freq -100000000
delay   2783
phc2sys[145.478]: CLOCK_REALTIME phc offset -36248054821 s2 freq -100000000
delay   2418
phc2sys[146.479]: CLOCK_REALTIME phc offset -36157110676 s2 freq -100000000
delay   1898
phc2sys[147.479]: clockcheck: clock jumped backward or running slower than
expected!
phc2sys[147.480]: CLOCK_REALTIME phc offset -38764638189 s0 freq -100000000
delay   2801
phc2sys[148.480]: CLOCK_REALTIME phc offset -38673617835 s2 freq +100000000
delay   3082
phc2sys[149.481]: CLOCK_REALTIME phc offset -38783850902 s2 freq -100000000
delay   2407
phc2sys[150.481]: CLOCK_REALTIME phc offset -38693706730 s2 freq -100000000
delay   3096
phc2sys[151.482]: CLOCK_REALTIME phc offset -38602710011 s2 freq -100000000
delay   2237
phc2sys[152.482]: CLOCK_REALTIME phc offset -38511760089 s2 freq -100000000
delay   2613
phc2sys[153.483]: CLOCK_REALTIME phc offset -38420785891 s2 freq -100000000
delay   3035
phc2sys[154.484]: CLOCK_REALTIME phc offset -38329774819 s2 freq -100000000
delay   2400

ethtool result on the master (Intel Nuc):

ethtool -T eno1
Time stamping parameters for eno1:
Capabilities:
hardware-transmit     (SOF_TIMESTAMPING_TX_HARDWARE)
software-transmit     (SOF_TIMESTAMPING_TX_SOFTWARE)
hardware-receive      (SOF_TIMESTAMPING_RX_HARDWARE)
software-receive      (SOF_TIMESTAMPING_RX_SOFTWARE)
software-system-clock (SOF_TIMESTAMPING_SOFTWARE)
hardware-raw-clock    (SOF_TIMESTAMPING_RAW_HARDWARE)
PTP Hardware Clock: 0
Hardware Transmit Timestamp Modes:
off                   (HWTSTAMP_TX_OFF)
on                    (HWTSTAMP_TX_ON)
Hardware Receive Filter Modes:
none                  (HWTSTAMP_FILTER_NONE)
all                   (HWTSTAMP_FILTER_ALL)
ptpv1-l4-sync         (HWTSTAMP_FILTER_PTP_V1_L4_SYNC)
ptpv1-l4-delay-req    (HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ)
ptpv2-l4-sync         (HWTSTAMP_FILTER_PTP_V2_L4_SYNC)
ptpv2-l4-delay-req    (HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ)
ptpv2-l2-sync         (HWTSTAMP_FILTER_PTP_V2_L2_SYNC)
ptpv2-l2-delay-req    (HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ)
ptpv2-event           (HWTSTAMP_FILTER_PTP_V2_EVENT)
ptpv2-sync            (HWTSTAMP_FILTER_PTP_V2_SYNC)
ptpv2-delay-req       (HWTSTAMP_FILTER_PTP_V2_DELAY_REQ)

Any suggestions?

Thanks,
Onur
_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users

Reply via email to