Re: [Linuxptp-users] Hardware PTP clock synchronization
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: Keller, J. E <jac...@in...> - 2013-08-01 17:44:47
|
> -----Original Message----- > From: Гаврилов Александр [mailto:le...@im...] > Sent: Thursday, August 01, 2013 12:55 AM > To: lin...@li... > Subject: [Linuxptp-users] Hardware PTP clock synchronization > > Hello! > > I encountered a problem while obtaining the time from the adapter Intel > pro1000 (82576). > I use Fedora 18 kernel version 3.9.6. > The values of the time I get through clock_gettime (id, timevalue) for the > device / dev/ptp0. > The source of the PTP packet is switch Hirschmann MAR1140. Wireshark > shows the presence of all necessary for the implementation of the > protocol PTP packets at the input adapter interface, > but the time in the PTP counters are not adjusted in accordance with the > values of the packages. > I compiled linuxptp-1.2 downloaded from > http://linuxptp.sourceforge.net/ and run the following commands: > > Hardware timestamping: > > # ptp4l -i p16p1 -p /dev/ptp0 -m -2 -H > You are on a modern kernel. Please do not use -p /dev/ptpX option. Let the program automatically determine it. It may be the case that you don't have the right ptp device. Richard: do we have a check in place to ensure the passed argument is correct if we can check? I don't remember. > ptp4l[3704.267]: selected /dev/ptp0 as PTP clock > ptp4l[3704.278]: port 1: INITIALIZING to LISTENING on INITIALIZE > ptp4l[3704.278]: port 0: INITIALIZING to LISTENING on INITIALIZE > ptp4l[3705.077]: port 1: new foreign master ece555.fffe.2de639-2 > ptp4l[3709.401]: selected best master clock ece555.fffe.2de639 > ptp4l[3709.401]: port 1: LISTENING to UNCALIBRATED on RS_SLAVE > ptp4l[3710.039]: recvmsg tx timestamp failed: Resource temporarily > unavailable This means your tx timestamp is not being properly detected. I don't know for sure why this is, but there are a few reasons. I will forward this to the intel engineer who designed the driver for this part. > ptp4l[3710.039]: port 1: send delay request failed > ptp4l[3710.039]: port 1: UNCALIBRATED to FAULTY on FAULT_DETECTED > ptp4l[3725.690]: port 1: FAULTY to LISTENING on FAULT_CLEARED > ptp4l[3726.698]: port 1: new foreign master ece555.fffe.2de639-2 > ptp4l[3731.022]: selected best master clock ece555.fffe.2de639 > ptp4l[3731.022]: port 1: LISTENING to UNCALIBRATED on RS_SLAVE > ptp4l[3731.193]: recvmsg tx timestamp failed: Resource temporarily > unavailable > ptp4l[3731.193]: port 1: send delay request failed > ptp4l[3731.193]: port 1: UNCALIBRATED to FAULTY on FAULT_DETECTED > hardware timestamping is not working correctly because you are not properly receiving the tx timestamps. > Software timestamping: > > # ptp4l -i p16p1 -p /dev/ptp0 -m -2 -S > > ptp4l[3826.218]: port 1: INITIALIZING to LISTENING on INITIALIZE > ptp4l[3826.218]: port 0: INITIALIZING to LISTENING on INITIALIZE > ptp4l[3828.312]: port 1: new foreign master ece555.fffe.2de639-2 > ptp4l[3832.218]: port 1: LISTENING to MASTER on > ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES > ptp4l[3832.636]: selected best master clock ece555.fffe.2de639 > ptp4l[3832.636]: port 1: MASTER to UNCALIBRATED on RS_SLAVE > ptp4l[3833.805]: negative path delay -3374260 > ptp4l[3833.805]: path_delay = (t2 - t3) + (t4 - t1) > ptp4l[3833.805]: t2 - t3 = -87573969 > ptp4l[3833.805]: t4 - t1 = +80825448 > ptp4l[3833.805]: c1 0 > ptp4l[3833.805]: c2 0 > ptp4l[3833.805]: c3 0 > ptp4l[3833.805]: port 1: minimum delay request interval 2^3 > ptp4l[3834.628]: negative path delay -35159469 > ptp4l[3834.628]: path_delay = (t2 - t3) + (t4 - t1) > ptp4l[3834.628]: t2 - t3 = -910670474 > ptp4l[3834.628]: t4 - t1 = +840351536 > ptp4l[3834.628]: c1 0 > ptp4l[3834.628]: c2 0 > ptp4l[3834.628]: c3 0 > ptp4l[3834.798]: master offset -10774702751233 s0 adj +0 path delay > -19266864 > ptp4l[3835.879]: master offset -10774619261329 s0 adj +0 path delay > -19266864 > > > What is the difference between hardware and software timestamping in > this case? > Why Hardware timestamping is not working properly? > Why software timestamping shows the correct time values, but does not > synchronize time with hardware ptp clock (/dev/ptp0)? > Hardware timestamping uses the ptp device, and coordinates with the driver for doing timestamps in the MAC or PHY. Software timestamping does software based stamps as late as possible in the driver. It does not use the PHC device at all and directly modifies the kernel time. They are completely different modes. > Sincerely, Alexander. > > Thanks, Jake |