[system-administrators-guide] Updates to ptp4l

stephenw stephenw at fedoraproject.org
Tue Dec 16 20:58:47 UTC 2014


commit 2cbf70b85cfa3c416c103868598cde570c91f0ea
Author: Stephen Wadeley <swadeley at redhat.com>
Date:   Tue Dec 16 21:57:41 2014 +0100

    Updates to ptp4l
    
    misc. updates from upstream version

 en-US/Configuring_PTP_Using_ptp4l.xml |   52 ++++++++++++++++++++++++++++++--
 1 files changed, 48 insertions(+), 4 deletions(-)
---
diff --git a/en-US/Configuring_PTP_Using_ptp4l.xml b/en-US/Configuring_PTP_Using_ptp4l.xml
index 0f5174c..e6ad252 100644
--- a/en-US/Configuring_PTP_Using_ptp4l.xml
+++ b/en-US/Configuring_PTP_Using_ptp4l.xml
@@ -145,6 +145,19 @@ should include:
 
 <section id="sec-Starting_ptp4l">
   <title>Starting ptp4l</title>
+    <para>
+The <application>ptp4l</application> program can be started from the command line or it can be started as a service. When running as a service, options are specified in the <filename>/etc/sysconfig/ptp4l</filename> file. Options required for use both by the service and on the command line should be specified in the <filename>/etc/ptp4l.conf</filename> file. The <filename>/etc/sysconfig/ptp4l</filename> file includes the <command>-f /etc/ptp4l.conf</command> command line option, which causes the <systemitem class="service">ptp4l</systemitem> program to read the <filename>/etc/ptp4l.conf</filename> file and process the options it contains. The use of the <filename>/etc/ptp4l.conf</filename> is explained in <xref linkend="sec-Specifying_a_Configuration_File" />. More information on the different <application>ptp4l</application> options and the configuration file settings can be found in the <filename>ptp4l(8)</filename> man page.</para>
+
+<bridgehead id="bh-Starting_ptp4l_as_a_Service">Starting ptp4l as a Service</bridgehead>
+
+<para>
+To start <application>ptp4l</application> as a service, issue the following command as <systemitem class="username">root</systemitem>:
+<screen>~]#&nbsp;<command>systemctl start ptp4l</command></screen>
+<!--For more information on managing system services in &MAJOROSVER;, see <xref linkend="chap-Managing_Services_with_systemd" />.-->
+</para>
+
+<bridgehead id="bh-Using_ptp4l_From_The_Command_Line">Using ptp4l From The Command Line</bridgehead>
+
   <para>
 The <application>ptp4l</application> program tries to use hardware time stamping by default. To use <application>ptp4l</application> with hardware time stamping capable drivers and NICs, you must provide the network interface to use with the <option>-i</option> option. Enter the following command as <systemitem class="username">root</systemitem>:
 <screen>~]#&nbsp;<command>ptp4l -i <replaceable>em3</replaceable> -m</command></screen>
@@ -326,9 +339,24 @@ if <literal>gmPresent</literal> is true, the <systemitem class="protocol">PTP</s
 <section id="sec-Synchronizing_the_Clocks">
   <title>Synchronizing the Clocks</title>
   <para>
-    The <application>phc2sys</application> program is used to synchronize the system clock to the <systemitem class="protocol">PTP</systemitem> hardware clock (<acronym>PHC</acronym>) on the NIC. To start <application>phc2sys</application>, where <replaceable>em3</replaceable> is the interface with the <systemitem class="protocol">PTP</systemitem> hardware clock, enter the following command as <systemitem class="username">root</systemitem>:
+    The <application>phc2sys</application> program is used to synchronize the system clock to the <systemitem class="protocol">PTP</systemitem> hardware clock (<acronym>PHC</acronym>) on the NIC. The <application>phc2sys</application> service is configured in the <filename>/etc/sysconfig/phc2sys</filename> configuration file. The default setting in the <filename>/etc/sysconfig/phc2sys</filename> file is as follows:
+    <synopsis>OPTIONS="-a -r"</synopsis>
+    The <option>-a</option> option causes <application>phc2sys</application> to read the clocks to be synchronized from the <application>ptp4l</application> application. It will follow changes in the <systemitem class="protocol">PTP</systemitem> port states, adjusting the synchronization between the NIC hardware clocks accordingly. The system clock is not synchronized, unless the <option>-r</option> option is also specified. If you want the system clock to be eligible to become a time source, specify the <option>-r</option> option twice.
+    </para>
+<para>
+After making changes to <filename>/etc/sysconfig/phc2sys</filename>, restart the <application>phc2sys</application> service from the command line by issuing a command as <systemitem class="username">root</systemitem>:
+<screen>~]# <command>systemctl restart phc2sys</command></screen>
+Under normal circumstances, use <command>systemctl</command> commands to start, stop, and restart the <application>phc2sys</application> service.
+    </para>
+    <para>
+When you do not want to start <application>phc2sys</application> as a service, you can start it from the command line. For example, enter the following command as <systemitem class="username">root</systemitem>:
+    <screen>~]#&nbsp;<command>phc2sys -a -r</command></screen>
+The <option>-a</option> option causes <application>phc2sys</application> to read the clocks to be synchronized from the <application>ptp4l</application> application. If you want the system clock to be eligible to become a time source, specify the <option>-r</option> option twice.
+  </para>
+  <para>
+  Alternately, use the <option>-s</option> option to synchronize the system clock to a specific interface's <systemitem class="protocol">PTP</systemitem> hardware clock. For example:
     <screen>~]#&nbsp;<command>phc2sys -s <replaceable>em3</replaceable> -w</command></screen>
-    The <option>-w</option> option waits for the running <application>ptp4l</application> application to synchronize the <systemitem class="protocol">PTP</systemitem> clock and then retrieves the <acronym>TAI</acronym> to <acronym>UTC</acronym> offset from <application>ptp4l</application>.
+The <option>-w</option> option waits for the running <application>ptp4l</application> application to synchronize the <systemitem class="protocol">PTP</systemitem> clock and then retrieves the <acronym>TAI</acronym> to <acronym>UTC</acronym> offset from <application>ptp4l</application>.
   </para>
   <para>
     Normally, <systemitem class="protocol">PTP</systemitem> operates in the <firstterm>International Atomic Time</firstterm> (<acronym>TAI</acronym>) timescale, while the system clock is kept in <firstterm>Coordinated Universal Time</firstterm> (<acronym>UTC</acronym>). The current offset between the TAI and UTC timescales is 35 seconds. The offset changes when leap seconds are inserted or deleted, which typically happens every few years. The <option>-O</option> option needs to be used to set this offset manually when the <option>-w</option> is not used, as follows:
@@ -464,8 +492,24 @@ priority1 127
 # ptp4l -f /etc/ptp4l.conf</screen>
 </para>
 <para>
-With hardware time stamping, <application>phc2sys</application> needs to be used to synchronize the <systemitem class="protocol">PTP</systemitem> hardware clock to the system clock:
-<screen>~]#&nbsp;<command>phc2sys -c <replaceable>em3</replaceable> -s CLOCK_REALTIME -w</command></screen>
+With hardware time stamping, <application>phc2sys</application> needs to be used to synchronize the <systemitem class="protocol">PTP</systemitem> hardware clock to the system clock.
+If running <application>phc2sys</application> as a service, edit the <filename>/etc/sysconfig/phc2sys</filename> configuration file. The default setting in the <filename>/etc/sysconfig/phc2sys</filename> file is as follows:
+<synopsis>OPTIONS="-a -r"</synopsis>
+As <systemitem class="username">root</systemitem>, edit that line as follows:
+<screen>~]# <command>vi /etc/sysconfig/phc2sys</command>
+OPTIONS="-a -r -r"</screen>
+The <option>-r</option> option is used twice here to allow synchronization of the <systemitem class="protocol">PTP</systemitem> hardware clock on the NIC from the system clock.
+Restart the <application>phc2sys</application> service for the changes to take effect:
+<screen>~]# <command>systemctl restart phc2sys</command></screen>
+</para>
+
+
+  <para>
+    To prevent quick changes in the <systemitem class="protocol">PTP</systemitem> clock's frequency, the synchronization to the system clock can be loosened by using smaller <option>P</option> (proportional) and <option>I</option> (integral) constants for the PI servo:
+<screen>~]#&nbsp;<command>phc2sys -a -r -r -P 0.01 -I 0.0001</command></screen>
+  </para>
+</section>
+
 <section id="sec-Synchronize_to_PTP_or_NTP_Time_Using_timemaster">
 <title>Synchronize to PTP or NTP Time Using timemaster</title>
 <para>


More information about the docs-commits mailing list