Configuring PTP devices

The PTP Operator adds the NodePtpDevice.ptp.openshift.io custom resource definition (CRD) to OKD.

When installed, the PTP Operator searches your cluster for PTP-capable network devices on each node. It creates and updates a NodePtpDevice custom resource (CR) object for each node that provides a compatible PTP-capable network device.

Installing the PTP Operator using the CLI

As a cluster administrator, you can install the Operator by using the CLI.

Prerequisites

  • A cluster installed on bare-metal hardware with nodes that have hardware that supports PTP.

  • Install the OpenShift CLI (oc).

  • Log in as a user with cluster-admin privileges.

Procedure

  1. Create a namespace for the PTP Operator.

    1. Save the following YAML in the ptp-namespace.yaml file:

      1. apiVersion: v1
      2. kind: Namespace
      3. metadata:
      4. name: openshift-ptp
      5. annotations:
      6. workload.openshift.io/allowed: management
      7. labels:
      8. name: openshift-ptp
      9. openshift.io/cluster-monitoring: "true"
    2. Create the Namespace CR:

      1. $ oc create -f ptp-namespace.yaml
  2. Create an Operator group for the PTP Operator.

    1. Save the following YAML in the ptp-operatorgroup.yaml file:

      1. apiVersion: operators.coreos.com/v1
      2. kind: OperatorGroup
      3. metadata:
      4. name: ptp-operators
      5. namespace: openshift-ptp
      6. spec:
      7. targetNamespaces:
      8. - openshift-ptp
    2. Create the OperatorGroup CR:

      1. $ oc create -f ptp-operatorgroup.yaml
  3. Subscribe to the PTP Operator.

    1. Save the following YAML in the ptp-sub.yaml file:

      1. apiVersion: operators.coreos.com/v1alpha1
      2. kind: Subscription
      3. metadata:
      4. name: ptp-operator-subscription
      5. namespace: openshift-ptp
      6. spec:
      7. channel: "stable"
      8. name: ptp-operator
      9. source: redhat-operators
      10. sourceNamespace: openshift-marketplace
    2. Create the Subscription CR:

      1. $ oc create -f ptp-sub.yaml
  4. To verify that the Operator is installed, enter the following command:

    1. $ oc get csv -n openshift-ptp -o custom-columns=Name:.metadata.name,Phase:.status.phase

    Example output

    1. Name Phase
    2. 4.0-202301261535 Succeeded

Installing the PTP Operator by using the web console

As a cluster administrator, you can install the PTP Operator by using the web console.

You have to create the namespace and Operator group as mentioned in the previous section.

Procedure

  1. Install the PTP Operator using the OKD web console:

    1. In the OKD web console, click OperatorsOperatorHub.

    2. Choose PTP Operator from the list of available Operators, and then click Install.

    3. On the Install Operator page, under A specific namespace on the cluster select openshift-ptp. Then, click Install.

  2. Optional: Verify that the PTP Operator installed successfully:

    1. Switch to the OperatorsInstalled Operators page.

    2. Ensure that PTP Operator is listed in the openshift-ptp project with a Status of InstallSucceeded.

      During installation an Operator might display a Failed status. If the installation later succeeds with an InstallSucceeded message, you can ignore the Failed message.

      If the Operator does not appear as installed, to troubleshoot further:

      • Go to the OperatorsInstalled Operators page and inspect the Operator Subscriptions and Install Plans tabs for any failure or errors under Status.

      • Go to the WorkloadsPods page and check the logs for pods in the openshift-ptp project.

Discovering PTP capable network devices in your cluster

  • To return a complete list of PTP capable network devices in your cluster, run the following command:

    1. $ oc get NodePtpDevice -n openshift-ptp -o yaml

    Example output

    1. apiVersion: v1
    2. items:
    3. - apiVersion: ptp.openshift.io/v1
    4. kind: NodePtpDevice
    5. metadata:
    6. creationTimestamp: "2022-01-27T15:16:28Z"
    7. generation: 1
    8. name: dev-worker-0 (1)
    9. namespace: openshift-ptp
    10. resourceVersion: "6538103"
    11. uid: d42fc9ad-bcbf-4590-b6d8-b676c642781a
    12. spec: {}
    13. status:
    14. devices: (2)
    15. - name: eno1
    16. - name: eno2
    17. - name: eno3
    18. - name: eno4
    19. - name: enp5s0f0
    20. - name: enp5s0f1
    21. ...
    1The value for the name parameter is the same as the name of the parent node.
    2The devices collection includes a list of the PTP capable devices that the PTP Operator discovers for the node.

Using hardware-specific NIC features with the PTP Operator

NIC hardware with built-in PTP capabilities sometimes require device-specific configuration. You can use hardware-specific NIC features for supported hardware with the PTP Operator by configuring a plugin in the PtpConfig custom resource (CR). The linuxptp-daemon service uses the named parameters in the plugin stanza to start linuxptp processes (ptp4l and phc2sys) based on the specific hardware configuration.

In OKD 4, the Intel E810 NIC is supported with a PtpConfig plugin.

Configuring linuxptp services as a grandmaster clock

You can configure the linuxptp services (ptp4l, phc2sys, ts2phc) as grandmaster clock (T-GM) by creating a PtpConfig custom resource (CR) that configures the host NIC.

The ts2phc utility allows you to synchronize the system clock with the PTP grandmaster clock so that the node can stream precision clock signal to downstream PTP ordinary clocks and boundary clocks.

Use the following example PtpConfig CR as the basis to configure linuxptp services as T-GM for an Intel Westport Channel E810-XXVDA4T network interface.

To configure PTP fast events, set appropriate values for ptp4lOpts, ptp4lConf, and ptpClockThreshold. ptpClockThreshold is used only when events are enabled. See “Configuring the PTP fast event notifications publisher” for more information.

Prerequisites

  • For T-GM clocks in production environments, install an Intel E810 Westport Channel NIC in the bare-metal cluster host.

  • Install the OpenShift CLI (oc).

  • Log in as a user with cluster-admin privileges.

  • Install the PTP Operator.

Procedure

  1. Create the PtpConfig CR. For example:

    1. Depending on your requirements, use one of the following T-GM configurations for your deployment. Save the YAML in the grandmaster-clock-ptp-config.yaml file:

      Example PTP grandmaster clock configuration

      1. apiVersion: ptp.openshift.io/v1
      2. kind: PtpConfig
      3. metadata:
      4. name: grandmaster
      5. namespace: openshift-ptp
      6. spec:
      7. profile:
      8. - name: "grandmaster"
      9. ptp4lOpts: "-2 --summary_interval -4"
      10. phc2sysOpts: -r -u 0 -m -O -37 -N 8 -R 16 -s $iface_master -n 24
      11. ptpSchedulingPolicy: SCHED_FIFO
      12. ptpSchedulingPriority: 10
      13. ptpSettings:
      14. logReduce: "true"
      15. plugins:
      16. e810:
      17. enableDefaultConfig: false
      18. settings:
      19. LocalMaxHoldoverOffSet: 1500
      20. LocalHoldoverTimeout: 14400
      21. MaxInSpecOffset: 100
      22. pins: $e810_pins
      23. # "$iface_master":
      24. # "U.FL2": "0 2"
      25. # "U.FL1": "0 1"
      26. # "SMA2": "0 2"
      27. # "SMA1": "0 1"
      28. ublxCmds:
      29. - args: #ubxtool -P 29.20 -z CFG-HW-ANT_CFG_VOLTCTRL,1
      30. - "-P"
      31. - "29.20"
      32. - "-z"
      33. - "CFG-HW-ANT_CFG_VOLTCTRL,1"
      34. reportOutput: false
      35. - args: #ubxtool -P 29.20 -e GPS
      36. - "-P"
      37. - "29.20"
      38. - "-e"
      39. - "GPS"
      40. reportOutput: false
      41. - args: #ubxtool -P 29.20 -d Galileo
      42. - "-P"
      43. - "29.20"
      44. - "-d"
      45. - "Galileo"
      46. reportOutput: false
      47. - args: #ubxtool -P 29.20 -d GLONASS
      48. - "-P"
      49. - "29.20"
      50. - "-d"
      51. - "GLONASS"
      52. reportOutput: false
      53. - args: #ubxtool -P 29.20 -d BeiDou
      54. - "-P"
      55. - "29.20"
      56. - "-d"
      57. - "BeiDou"
      58. reportOutput: false
      59. - args: #ubxtool -P 29.20 -d SBAS
      60. - "-P"
      61. - "29.20"
      62. - "-d"
      63. - "SBAS"
      64. reportOutput: false
      65. - args: #ubxtool -P 29.20 -t -w 5 -v 1 -e SURVEYIN,600,50000
      66. - "-P"
      67. - "29.20"
      68. - "-t"
      69. - "-w"
      70. - "5"
      71. - "-v"
      72. - "1"
      73. - "-e"
      74. - "SURVEYIN,600,50000"
      75. reportOutput: true
      76. - args: #ubxtool -P 29.20 -p MON-HW
      77. - "-P"
      78. - "29.20"
      79. - "-p"
      80. - "MON-HW"
      81. reportOutput: true
      82. ts2phcOpts: " "
      83. ts2phcConf: |
      84. [nmea]
      85. ts2phc.master 1
      86. [global]
      87. use_syslog 0
      88. verbose 1
      89. logging_level 7
      90. ts2phc.pulsewidth 100000000
      91. ts2phc.nmea_serialport $gnss_serialport
      92. leapfile /usr/share/zoneinfo/leap-seconds.list
      93. [$iface_master]
      94. ts2phc.extts_polarity rising
      95. ts2phc.extts_correction 0
      96. ptp4lConf: |
      97. [$iface_master]
      98. masterOnly 1
      99. [$iface_master_1]
      100. masterOnly 1
      101. [$iface_master_2]
      102. masterOnly 1
      103. [$iface_master_3]
      104. masterOnly 1
      105. [global]
      106. #
      107. # Default Data Set
      108. #
      109. twoStepFlag 1
      110. priority1 128
      111. priority2 128
      112. domainNumber 24
      113. #utc_offset 37
      114. clockClass 6
      115. clockAccuracy 0x27
      116. offsetScaledLogVariance 0xFFFF
      117. free_running 0
      118. freq_est_interval 1
      119. dscp_event 0
      120. dscp_general 0
      121. dataset_comparison G.8275.x
      122. G.8275.defaultDS.localPriority 128
      123. #
      124. # Port Data Set
      125. #
      126. logAnnounceInterval -3
      127. logSyncInterval -4
      128. logMinDelayReqInterval -4
      129. logMinPdelayReqInterval 0
      130. announceReceiptTimeout 3
      131. syncReceiptTimeout 0
      132. delayAsymmetry 0
      133. fault_reset_interval -4
      134. neighborPropDelayThresh 20000000
      135. masterOnly 0
      136. G.8275.portDS.localPriority 128
      137. #
      138. # Run time options
      139. #
      140. assume_two_step 0
      141. logging_level 6
      142. path_trace_enabled 0
      143. follow_up_info 0
      144. hybrid_e2e 0
      145. inhibit_multicast_service 0
      146. net_sync_monitor 0
      147. tc_spanning_tree 0
      148. tx_timestamp_timeout 50
      149. unicast_listen 0
      150. unicast_master_table 0
      151. unicast_req_duration 3600
      152. use_syslog 1
      153. verbose 0
      154. summary_interval -4
      155. kernel_leap 1
      156. check_fup_sync 0
      157. clock_class_threshold 7
      158. #
      159. # Servo Options
      160. #
      161. pi_proportional_const 0.0
      162. pi_integral_const 0.0
      163. pi_proportional_scale 0.0
      164. pi_proportional_exponent -0.3
      165. pi_proportional_norm_max 0.7
      166. pi_integral_scale 0.0
      167. pi_integral_exponent 0.4
      168. pi_integral_norm_max 0.3
      169. step_threshold 2.0
      170. first_step_threshold 0.00002
      171. clock_servo pi
      172. sanity_freq_limit 200000000
      173. ntpshm_segment 0
      174. #
      175. # Transport options
      176. #
      177. transportSpecific 0x0
      178. ptp_dst_mac 01:1B:19:00:00:00
      179. p2p_dst_mac 01:80:C2:00:00:0E
      180. udp_ttl 1
      181. udp6_scope 0x0E
      182. uds_address /var/run/ptp4l
      183. #
      184. # Default interface options
      185. #
      186. clock_type BC
      187. network_transport L2
      188. delay_mechanism E2E
      189. time_stamping hardware
      190. tsproc_mode filter
      191. delay_filter moving_median
      192. delay_filter_length 10
      193. egressLatency 0
      194. ingressLatency 0
      195. boundary_clock_jbod 0
      196. #
      197. # Clock description
      198. #
      199. productDescription ;;
      200. revisionData ;;
      201. manufacturerIdentity 00:00:00
      202. userDescription ;
      203. timeSource 0x20
      204. recommend:
      205. - profile: "grandmaster"
      206. priority: 4
      207. match:
      208. - nodeLabel: "node-role.kubernetes.io/$mcp"

      The example PTP grandmaster clock configuration is for test purposes only and is not intended for production.

      PTP grandmaster clock configuration for E810 NIC

      1. apiVersion: ptp.openshift.io/v1
      2. kind: PtpConfig
      3. metadata:
      4. name: grandmaster
      5. namespace: openshift-ptp
      6. spec:
      7. profile:
      8. - name: "grandmaster"
      9. ptp4lOpts: "-2 --summary_interval -4"
      10. phc2sysOpts: -r -u 0 -m -O -37 -N 8 -R 16 -s $iface_master -n 24
      11. ptpSchedulingPolicy: SCHED_FIFO
      12. ptpSchedulingPriority: 10
      13. ptpSettings:
      14. logReduce: "true"
      15. plugins:
      16. e810:
      17. enableDefaultConfig: false
      18. settings:
      19. LocalMaxHoldoverOffSet: 1500
      20. LocalHoldoverTimeout: 14400
      21. MaxInSpecOffset: 100
      22. pins: $e810_pins
      23. # "$iface_master":
      24. # "U.FL2": "0 2"
      25. # "U.FL1": "0 1"
      26. # "SMA2": "0 2"
      27. # "SMA1": "0 1"
      28. ublxCmds:
      29. - args: #ubxtool -P 29.20 -z CFG-HW-ANT_CFG_VOLTCTRL,1
      30. - "-P"
      31. - "29.20"
      32. - "-z"
      33. - "CFG-HW-ANT_CFG_VOLTCTRL,1"
      34. reportOutput: false
      35. - args: #ubxtool -P 29.20 -e GPS
      36. - "-P"
      37. - "29.20"
      38. - "-e"
      39. - "GPS"
      40. reportOutput: false
      41. - args: #ubxtool -P 29.20 -d Galileo
      42. - "-P"
      43. - "29.20"
      44. - "-d"
      45. - "Galileo"
      46. reportOutput: false
      47. - args: #ubxtool -P 29.20 -d GLONASS
      48. - "-P"
      49. - "29.20"
      50. - "-d"
      51. - "GLONASS"
      52. reportOutput: false
      53. - args: #ubxtool -P 29.20 -d BeiDou
      54. - "-P"
      55. - "29.20"
      56. - "-d"
      57. - "BeiDou"
      58. reportOutput: false
      59. - args: #ubxtool -P 29.20 -d SBAS
      60. - "-P"
      61. - "29.20"
      62. - "-d"
      63. - "SBAS"
      64. reportOutput: false
      65. - args: #ubxtool -P 29.20 -t -w 5 -v 1 -e SURVEYIN,600,50000
      66. - "-P"
      67. - "29.20"
      68. - "-t"
      69. - "-w"
      70. - "5"
      71. - "-v"
      72. - "1"
      73. - "-e"
      74. - "SURVEYIN,600,50000"
      75. reportOutput: true
      76. - args: #ubxtool -P 29.20 -p MON-HW
      77. - "-P"
      78. - "29.20"
      79. - "-p"
      80. - "MON-HW"
      81. reportOutput: true
      82. ts2phcOpts: " "
      83. ts2phcConf: |
      84. [nmea]
      85. ts2phc.master 1
      86. [global]
      87. use_syslog 0
      88. verbose 1
      89. logging_level 7
      90. ts2phc.pulsewidth 100000000
      91. ts2phc.nmea_serialport $gnss_serialport
      92. leapfile /usr/share/zoneinfo/leap-seconds.list
      93. [$iface_master]
      94. ts2phc.extts_polarity rising
      95. ts2phc.extts_correction 0
      96. ptp4lConf: |
      97. [$iface_master]
      98. masterOnly 1
      99. [$iface_master_1]
      100. masterOnly 1
      101. [$iface_master_2]
      102. masterOnly 1
      103. [$iface_master_3]
      104. masterOnly 1
      105. [global]
      106. #
      107. # Default Data Set
      108. #
      109. twoStepFlag 1
      110. priority1 128
      111. priority2 128
      112. domainNumber 24
      113. #utc_offset 37
      114. clockClass 6
      115. clockAccuracy 0x27
      116. offsetScaledLogVariance 0xFFFF
      117. free_running 0
      118. freq_est_interval 1
      119. dscp_event 0
      120. dscp_general 0
      121. dataset_comparison G.8275.x
      122. G.8275.defaultDS.localPriority 128
      123. #
      124. # Port Data Set
      125. #
      126. logAnnounceInterval -3
      127. logSyncInterval -4
      128. logMinDelayReqInterval -4
      129. logMinPdelayReqInterval 0
      130. announceReceiptTimeout 3
      131. syncReceiptTimeout 0
      132. delayAsymmetry 0
      133. fault_reset_interval -4
      134. neighborPropDelayThresh 20000000
      135. masterOnly 0
      136. G.8275.portDS.localPriority 128
      137. #
      138. # Run time options
      139. #
      140. assume_two_step 0
      141. logging_level 6
      142. path_trace_enabled 0
      143. follow_up_info 0
      144. hybrid_e2e 0
      145. inhibit_multicast_service 0
      146. net_sync_monitor 0
      147. tc_spanning_tree 0
      148. tx_timestamp_timeout 50
      149. unicast_listen 0
      150. unicast_master_table 0
      151. unicast_req_duration 3600
      152. use_syslog 1
      153. verbose 0
      154. summary_interval -4
      155. kernel_leap 1
      156. check_fup_sync 0
      157. clock_class_threshold 7
      158. #
      159. # Servo Options
      160. #
      161. pi_proportional_const 0.0
      162. pi_integral_const 0.0
      163. pi_proportional_scale 0.0
      164. pi_proportional_exponent -0.3
      165. pi_proportional_norm_max 0.7
      166. pi_integral_scale 0.0
      167. pi_integral_exponent 0.4
      168. pi_integral_norm_max 0.3
      169. step_threshold 2.0
      170. first_step_threshold 0.00002
      171. clock_servo pi
      172. sanity_freq_limit 200000000
      173. ntpshm_segment 0
      174. #
      175. # Transport options
      176. #
      177. transportSpecific 0x0
      178. ptp_dst_mac 01:1B:19:00:00:00
      179. p2p_dst_mac 01:80:C2:00:00:0E
      180. udp_ttl 1
      181. udp6_scope 0x0E
      182. uds_address /var/run/ptp4l
      183. #
      184. # Default interface options
      185. #
      186. clock_type BC
      187. network_transport L2
      188. delay_mechanism E2E
      189. time_stamping hardware
      190. tsproc_mode filter
      191. delay_filter moving_median
      192. delay_filter_length 10
      193. egressLatency 0
      194. ingressLatency 0
      195. boundary_clock_jbod 0
      196. #
      197. # Clock description
      198. #
      199. productDescription ;;
      200. revisionData ;;
      201. manufacturerIdentity 00:00:00
      202. userDescription ;
      203. timeSource 0x20
      204. recommend:
      205. - profile: "grandmaster"
      206. priority: 4
      207. match:
      208. - nodeLabel: "node-role.kubernetes.io/$mcp"

      For E810 Westport Channel NICs, set the value for ts2phc.nmea_serialport to /dev/gnss0.

    2. Create the CR by running the following command:

      1. $ oc create -f grandmaster-clock-ptp-config.yaml

Verification

  1. Check that the PtpConfig profile is applied to the node.

    1. Get the list of pods in the openshift-ptp namespace by running the following command:

      1. $ oc get pods -n openshift-ptp -o wide

      Example output

      1. NAME READY STATUS RESTARTS AGE IP NODE
      2. linuxptp-daemon-74m2g 3/3 Running 3 4d15h 10.16.230.7 compute-1.example.com
      3. ptp-operator-5f4f48d7c-x7zkf 1/1 Running 1 4d15h 10.128.1.145 compute-1.example.com
    2. Check that the profile is correct. Examine the logs of the linuxptp daemon that corresponds to the node you specified in the PtpConfig profile. Run the following command:

      1. $ oc logs linuxptp-daemon-74m2g -n openshift-ptp -c linuxptp-daemon-container

      Example output

      1. ts2phc[94980.334]: [ts2phc.0.config] nmea delay: 98690975 ns
      2. ts2phc[94980.334]: [ts2phc.0.config] ens3f0 extts index 0 at 1676577329.999999999 corr 0 src 1676577330.901342528 diff -1
      3. ts2phc[94980.334]: [ts2phc.0.config] ens3f0 master offset -1 s2 freq -1
      4. ts2phc[94980.441]: [ts2phc.0.config] nmea sentence: GNRMC,195453.00,A,4233.24427,N,07126.64420,W,0.008,,160223,,,A,V
      5. phc2sys[94980.450]: [ptp4l.0.config] CLOCK_REALTIME phc offset 943 s2 freq -89604 delay 504
      6. phc2sys[94980.512]: [ptp4l.0.config] CLOCK_REALTIME phc offset 1000 s2 freq -89264 delay 474

Additional resources

Grandmaster clock PtpConfig configuration reference

The following reference information describes the configuration options for the PtpConfig custom resource (CR) that configures the linuxptp services (ptp4l, phc2sys, ts2phc) as a grandmaster clock.

Table 1. PtpConfig configuration options for PTP Grandmaster clock
PtpConfig CR fieldDescription

plugins

Specify an array of .exec.cmdline options that configure the NIC for grandmaster clock operation. Grandmaster clock configuration requires certain PTP pins to be disabled.

The plugin mechanism allows the PTP Operator to do automated hardware configuration. For the Intel Westport Channel NIC, when enableDefaultConfig is true, The PTP Operator runs a hard-coded script to do the required configuration for the NIC.

ptp4lOpts

Specify system configuration options for the ptp4l service. The options should not include the network interface name -i <interface> and service config file -f /etc/ptp4l.conf because the network interface name and the service config file are automatically appended.

ptp4lConf

Specify the required configuration to start ptp4l as a grandmaster clock. For example, the ens2f1 interface synchronizes downstream connected devices. For grandmaster clocks, set clockClass to 6 and set clockAccuracy to 0x27. Set timeSource to 0x20 for when receiving the timing signal from a Global navigation satellite system (GNSS).

tx_timestamp_timeout

Specify the maximum amount of time to wait for the transmit (TX) timestamp from the sender before discarding the data.

boundary_clock_jbod

Specify the JBOD boundary clock time delay value. This value is used to correct the time values that are passed between the network time devices.

phc2sysOpts

Specify system config options for the phc2sys service. If this field is empty the PTP Operator does not start the phc2sys service.

Ensure that the network interface listed here is configured as grandmaster and is referenced as required in the ts2phcConf and ptp4lConf fields.

ptpSchedulingPolicy

Configure the scheduling policy for ptp4l and phc2sys processes. Default value is SCHED_OTHER. Use SCHED_FIFO on systems that support FIFO scheduling.

ptpSchedulingPriority

Set an integer value from 1-65 to configure FIFO priority for ptp4l and phc2sys processes when ptpSchedulingPolicy is set to SCHED_FIFO. The ptpSchedulingPriority field is not used when ptpSchedulingPolicy is set to SCHED_OTHER.

ptpClockThreshold

Optional. If ptpClockThreshold stanza is not present, default values are used for ptpClockThreshold fields. Stanza shows default ptpClockThreshold values. ptpClockThreshold values configure how long after the PTP master clock is disconnected before PTP events are triggered. holdOverTimeout is the time value in seconds before the PTP clock event state changes to FREERUN when the PTP master clock is disconnected. The maxOffsetThreshold and minOffsetThreshold settings configure offset values in nanoseconds that compare against the values for CLOCK_REALTIME (phc2sys) or master offset (ptp4l). When the ptp4l or phc2sys offset value is outside this range, the PTP clock state is set to FREERUN. When the offset value is within this range, the PTP clock state is set to LOCKED.

ts2phcConf

Sets the configuration for the ts2phc command.

leapfile is the default path to the current leap seconds definition file in the PTP Operator container image.

ts2phc.nmea_serialport is the serial port device that is connected to the NMEA GPS clock source. When configured, the GNSS receiver is accessible on /dev/gnss<id>. If the host has multiple GNSS receivers, you can find the correct device by enumerating either of the following devices:

  • /sys/class/net/<eth_port>/device/gnss/

  • /sys/class/gnss/gnss<id>/device/

ts2phcOpts

Set options for the ts2phc command.

recommend

Specify an array of one or more recommend objects that define rules on how the profile should be applied to nodes.

.recommend.profile

Specify the .recommend.profile object name that is defined in the profile section.

.recommend.priority

Specify the priority with an integer value between 0 and 99. A larger number gets lower priority, so a priority of 99 is lower than a priority of 10. If a node can be matched with multiple profiles according to rules defined in the match field, the profile with the higher priority is applied to that node.

.recommend.match

Specify .recommend.match rules with nodeLabel or nodeName values.

.recommend.match.nodeLabel

Set nodeLabel with the key of the node.Labels field from the node object by using the oc get nodes —show-labels command. For example, node-role.kubernetes.io/worker.

.recommend.match.nodeName

Set nodeName with the value of the node.Name field from the node object by using the oc get nodes command. For example, compute-1.example.com.

Grandmaster clock class sync state reference

The following table describes the PTP grandmaster clock (T-GM) gm.ClockClass states. Clock class states categorize T-GM clocks based on their accuracy and stability with regard to the Primary Reference Time Clock (PRTC) or other timing source.

Holdover specification is the amount of time a PTP clock can maintain synchronization without receiving updates from the primary time source.

Table 2. T-GM clock class states
Clock class stateDescription

gm.ClockClass 6

T-GM clock is connected to a PRTC in LOCKED mode. For example, the PRTC is traceable to a GNSS time source.

gm.ClockClass 7

T-GM clock is in HOLDOVER mode, and within holdover specification. The clock source might not be traceable to a category 1 frequency source.

gm.ClockClass 140

T-GM clock is in HOLDOVER mode, is out of holdover specification, but it is still traceable to the category 1 frequency source.

gm.ClockClass 248

T-GM clock is in FREERUN mode.

For more information, see “Phase/time traceability information”, ITU-T G.8275.1/Y.1369.1 Recommendations.

Intel Westport Channel E810 hardware configuration reference

Use this information to understand how to use the Intel E810-XXVDA4T hardware plugin to configure the E810 network interface as PTP grandmaster clock. Hardware pin configuration determines how the network interface interacts with other components and devices in the system. The E810-XXVDA4T NIC has four connectors for external 1PPS signals: SMA1, SMA2, U.FL1, and U.FL2.

Table 3. Intel E810 NIC hardware connectors configuration
Hardware pinRecommended settingDescription

U.FL1

0 1

Disables the U.FL1 connector input. The U.FL1 connector is output-only.

U.FL2

0 2

Disables the U.FL2 connector output. The U.FL2 connector is input-only.

SMA1

0 1

Disables the SMA1 connector input. The SMA1 connector is bidirectional.

SMA2

0 2

Disables the SMA2 connector output. The SMA2 connector is bidirectional.

SMA1 and U.FL1 connectors share channel one. SMA2 and U.FL2 connectors share channel two.

Set spec.profile.plugins.e810.ublxCmds parameters to configure the GNSS clock in the PtpConfig custom resource (CR). Each of these ublxCmds stanzas correspond to a configuration that is applied to the host NIC by using ubxtool commands. For example:

  1. ublxCmds:
  2. - args: #ubxtool -P 29.20 -z CFG-HW-ANT_CFG_VOLTCTRL,1
  3. - "-P"
  4. - "29.20"
  5. - "-z"
  6. - "CFG-HW-ANT_CFG_VOLTCTRL,1"
  7. reportOutput: false

The following table describes the equivalent ubxtool commands:

Table 4. Intel E810 ublxCmds configuration
ubxtool commandDescription

ubxtool -P 29.20 -z CFG-HW-ANT_CFG_VOLTCTRL,1

Enables antenna voltage control. Enables antenna status to be reported in the UBX-MON-RF and UBX-INF-NOTICE log messages.

ubxtool -P 29.20 -e GPS

Enables the antenna to receive GPS signals.

ubxtool -P 29.20 -d Galileo

Configures the antenna to receive signal from the Galileo GPS satellite.

ubxtool -P 29.20 -d GLONASS

Disables the antenna from receiving signal from the GLONASS GPS satellite.

ubxtool -P 29.20 -d BeiDou

Disables the antenna from receiving signal from the BeiDou GPS satellite.

ubxtool -P 29.20 -d SBAS

Disables the antenna from receiving signal from the SBAS GPS satellite.

ubxtool -P 29.20 -t -w 5 -v 1 -e SURVEYIN,600,50000

Configures the GNSS receiver survey-in process to improve its initial position estimate. This can take up to 24 hours to achieve an optimal result.

ubxtool -P 29.20 -p MON-HW

Runs a single automated scan of the hardware and reports on the NIC state and configuration settings.

The E810 plugin implements the following interfaces:

Table 5. E810 plugin interfaces
InterfaceDescription

OnPTPConfigChangeE810

Runs whenever you update the PtpConfig CR. The function parses the plugin options and applies the required configurations to the network device pins based on the configuration data.

AfterRunPTPCommandE810

Runs after launching the PTP processes and running the gpspipe PTP command. The function processes the plugin options and runs ubxtool commands, storing the output in the plugin-specific data.

PopulateHwConfigE810

Populates the NodePtpDevice CR based on hardware-specific data in the PtpConfig CR.

The E810 plugin has the following structs and variables:

Table 6. E810 plugin structs and variables
StructDescription

E810Opts

Represents options for the E810 plugin, including boolean flags and a map of network device pins.

E810UblxCmds

Represents configurations for ubxtool commands with a boolean flag and a slice of strings for command arguments.

E810PluginData

Holds plugin-specific data used during plugin execution.

Configuring linuxptp services as a boundary clock

You can configure the linuxptp services (ptp4l, phc2sys) as boundary clock by creating a PtpConfig custom resource (CR) object.

Use the following example PtpConfig CR as the basis to configure linuxptp services as the boundary clock for your particular hardware and environment. This example CR does not configure PTP fast events. To configure PTP fast events, set appropriate values for ptp4lOpts, ptp4lConf, and ptpClockThreshold. ptpClockThreshold is used only when events are enabled. See “Configuring the PTP fast event notifications publisher” for more information.

Prerequisites

  • Install the OpenShift CLI (oc).

  • Log in as a user with cluster-admin privileges.

  • Install the PTP Operator.

Procedure

  1. Create the following PtpConfig CR, and then save the YAML in the boundary-clock-ptp-config.yaml file.

    Example PTP boundary clock configuration

    1. apiVersion: ptp.openshift.io/v1
    2. kind: PtpConfig
    3. metadata:
    4. name: boundary-clock
    5. namespace: openshift-ptp
    6. annotations: {}
    7. spec:
    8. profile:
    9. - name: boundary-clock
    10. ptp4lOpts: "-2"
    11. phc2sysOpts: "-a -r -n 24"
    12. ptpSchedulingPolicy: SCHED_FIFO
    13. ptpSchedulingPriority: 10
    14. ptpSettings:
    15. logReduce: "true"
    16. ptp4lConf: |
    17. # The interface name is hardware-specific
    18. [$iface_slave]
    19. masterOnly 0
    20. [$iface_master_1]
    21. masterOnly 1
    22. [$iface_master_2]
    23. masterOnly 1
    24. [$iface_master_3]
    25. masterOnly 1
    26. [global]
    27. #
    28. # Default Data Set
    29. #
    30. twoStepFlag 1
    31. slaveOnly 0
    32. priority1 128
    33. priority2 128
    34. domainNumber 24
    35. #utc_offset 37
    36. clockClass 248
    37. clockAccuracy 0xFE
    38. offsetScaledLogVariance 0xFFFF
    39. free_running 0
    40. freq_est_interval 1
    41. dscp_event 0
    42. dscp_general 0
    43. dataset_comparison G.8275.x
    44. G.8275.defaultDS.localPriority 128
    45. #
    46. # Port Data Set
    47. #
    48. logAnnounceInterval -3
    49. logSyncInterval -4
    50. logMinDelayReqInterval -4
    51. logMinPdelayReqInterval -4
    52. announceReceiptTimeout 3
    53. syncReceiptTimeout 0
    54. delayAsymmetry 0
    55. fault_reset_interval -4
    56. neighborPropDelayThresh 20000000
    57. masterOnly 0
    58. G.8275.portDS.localPriority 128
    59. #
    60. # Run time options
    61. #
    62. assume_two_step 0
    63. logging_level 6
    64. path_trace_enabled 0
    65. follow_up_info 0
    66. hybrid_e2e 0
    67. inhibit_multicast_service 0
    68. net_sync_monitor 0
    69. tc_spanning_tree 0
    70. tx_timestamp_timeout 50
    71. unicast_listen 0
    72. unicast_master_table 0
    73. unicast_req_duration 3600
    74. use_syslog 1
    75. verbose 0
    76. summary_interval 0
    77. kernel_leap 1
    78. check_fup_sync 0
    79. clock_class_threshold 135
    80. #
    81. # Servo Options
    82. #
    83. pi_proportional_const 0.0
    84. pi_integral_const 0.0
    85. pi_proportional_scale 0.0
    86. pi_proportional_exponent -0.3
    87. pi_proportional_norm_max 0.7
    88. pi_integral_scale 0.0
    89. pi_integral_exponent 0.4
    90. pi_integral_norm_max 0.3
    91. step_threshold 2.0
    92. first_step_threshold 0.00002
    93. max_frequency 900000000
    94. clock_servo pi
    95. sanity_freq_limit 200000000
    96. ntpshm_segment 0
    97. #
    98. # Transport options
    99. #
    100. transportSpecific 0x0
    101. ptp_dst_mac 01:1B:19:00:00:00
    102. p2p_dst_mac 01:80:C2:00:00:0E
    103. udp_ttl 1
    104. udp6_scope 0x0E
    105. uds_address /var/run/ptp4l
    106. #
    107. # Default interface options
    108. #
    109. clock_type BC
    110. network_transport L2
    111. delay_mechanism E2E
    112. time_stamping hardware
    113. tsproc_mode filter
    114. delay_filter moving_median
    115. delay_filter_length 10
    116. egressLatency 0
    117. ingressLatency 0
    118. boundary_clock_jbod 0
    119. #
    120. # Clock description
    121. #
    122. productDescription ;;
    123. revisionData ;;
    124. manufacturerIdentity 00:00:00
    125. userDescription ;
    126. timeSource 0xA0
    127. recommend:
    128. - profile: boundary-clock
    129. priority: 4
    130. match:
    131. - nodeLabel: "node-role.kubernetes.io/$mcp"
    Table 7. PTP boundary clock CR configuration options
    CR fieldDescription

    name

    The name of the PtpConfig CR.

    profile

    Specify an array of one or more profile objects.

    name

    Specify the name of a profile object which uniquely identifies a profile object.

    ptp4lOpts

    Specify system config options for the ptp4l service. The options should not include the network interface name -i <interface> and service config file -f /etc/ptp4l.conf because the network interface name and the service config file are automatically appended.

    ptp4lConf

    Specify the required configuration to start ptp4l as boundary clock. For example, ens1f0 synchronizes from a grandmaster clock and ens1f3 synchronizes connected devices.

    <interface_1>

    The interface that receives the synchronization clock.

    <interface_2>

    The interface that sends the synchronization clock.

    tx_timestamp_timeout

    For Intel Columbiaville 800 Series NICs, set tx_timestamp_timeout to 50.

    boundary_clock_jbod

    For Intel Columbiaville 800 Series NICs, ensure boundary_clock_jbod is set to 0. For Intel Fortville X710 Series NICs, ensure boundary_clock_jbod is set to 1.

    phc2sysOpts

    Specify system config options for the phc2sys service. If this field is empty, the PTP Operator does not start the phc2sys service.

    ptpSchedulingPolicy

    Scheduling policy for ptp4l and phc2sys processes. Default value is SCHED_OTHER. Use SCHED_FIFO on systems that support FIFO scheduling.

    ptpSchedulingPriority

    Integer value from 1-65 used to set FIFO priority for ptp4l and phc2sys processes when ptpSchedulingPolicy is set to SCHED_FIFO. The ptpSchedulingPriority field is not used when ptpSchedulingPolicy is set to SCHED_OTHER.

    ptpClockThreshold

    Optional. If ptpClockThreshold is not present, default values are used for the ptpClockThreshold fields. ptpClockThreshold configures how long after the PTP master clock is disconnected before PTP events are triggered. holdOverTimeout is the time value in seconds before the PTP clock event state changes to FREERUN when the PTP master clock is disconnected. The maxOffsetThreshold and minOffsetThreshold settings configure offset values in nanoseconds that compare against the values for CLOCK_REALTIME (phc2sys) or master offset (ptp4l). When the ptp4l or phc2sys offset value is outside this range, the PTP clock state is set to FREERUN. When the offset value is within this range, the PTP clock state is set to LOCKED.

    recommend

    Specify an array of one or more recommend objects that define rules on how the profile should be applied to nodes.

    .recommend.profile

    Specify the .recommend.profile object name defined in the profile section.

    .recommend.priority

    Specify the priority with an integer value between 0 and 99. A larger number gets lower priority, so a priority of 99 is lower than a priority of 10. If a node can be matched with multiple profiles according to rules defined in the match field, the profile with the higher priority is applied to that node.

    .recommend.match

    Specify .recommend.match rules with nodeLabel or nodeName values.

    .recommend.match.nodeLabel

    Set nodeLabel with the key of the node.Labels field from the node object by using the oc get nodes —show-labels command. For example, node-role.kubernetes.io/worker.

    .recommend.match.nodeName

    Set nodeName with the value of the node.Name field from the node object by using the oc get nodes command. For example, compute-1.example.com.

  2. Create the CR by running the following command:

    1. $ oc create -f boundary-clock-ptp-config.yaml

Verification

  1. Check that the PtpConfig profile is applied to the node.

    1. Get the list of pods in the openshift-ptp namespace by running the following command:

      1. $ oc get pods -n openshift-ptp -o wide

      Example output

      1. NAME READY STATUS RESTARTS AGE IP NODE
      2. linuxptp-daemon-4xkbb 1/1 Running 0 43m 10.1.196.24 compute-0.example.com
      3. linuxptp-daemon-tdspf 1/1 Running 0 43m 10.1.196.25 compute-1.example.com
      4. ptp-operator-657bbb64c8-2f8sj 1/1 Running 0 43m 10.129.0.61 control-plane-1.example.com
    2. Check that the profile is correct. Examine the logs of the linuxptp daemon that corresponds to the node you specified in the PtpConfig profile. Run the following command:

      1. $ oc logs linuxptp-daemon-4xkbb -n openshift-ptp -c linuxptp-daemon-container

      Example output

      1. I1115 09:41:17.117596 4143292 daemon.go:107] in applyNodePTPProfile
      2. I1115 09:41:17.117604 4143292 daemon.go:109] updating NodePTPProfile to:
      3. I1115 09:41:17.117607 4143292 daemon.go:110] ------------------------------------
      4. I1115 09:41:17.117612 4143292 daemon.go:102] Profile Name: profile1
      5. I1115 09:41:17.117616 4143292 daemon.go:102] Interface:
      6. I1115 09:41:17.117620 4143292 daemon.go:102] Ptp4lOpts: -2
      7. I1115 09:41:17.117623 4143292 daemon.go:102] Phc2sysOpts: -a -r -n 24
      8. I1115 09:41:17.117626 4143292 daemon.go:116] ------------------------------------

Additional resources

Configuring linuxptp services as boundary clocks for dual NIC hardware

Precision Time Protocol (PTP) hardware with dual NIC configured as boundary clocks is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.

For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.

You can configure the linuxptp services (ptp4l, phc2sys) as boundary clocks for dual NIC hardware by creating a PtpConfig custom resource (CR) object for each NIC.

Dual NIC hardware allows you to connect each NIC to the same upstream leader clock with separate ptp4l instances for each NIC feeding the downstream clocks.

Prerequisites

  • Install the OpenShift CLI (oc).

  • Log in as a user with cluster-admin privileges.

  • Install the PTP Operator.

Procedure

  1. Create two separate PtpConfig CRs, one for each NIC, using the reference CR in “Configuring linuxptp services as a boundary clock” as the basis for each CR. For example:

    1. Create boundary-clock-ptp-config-nic1.yaml, specifying values for phc2sysOpts:

      1. apiVersion: ptp.openshift.io/v1
      2. kind: PtpConfig
      3. metadata:
      4. name: boundary-clock-ptp-config-nic1
      5. namespace: openshift-ptp
      6. spec:
      7. profile:
      8. - name: "profile1"
      9. ptp4lOpts: "-2 --summary_interval -4"
      10. ptp4lConf: | (1)
      11. [ens5f1]
      12. masterOnly 1
      13. [ens5f0]
      14. masterOnly 0
      15. ...
      16. phc2sysOpts: "-a -r -m -n 24 -N 8 -R 16" (2)
      1Specify the required interfaces to start ptp4l as a boundary clock. For example, ens5f0 synchronizes from a grandmaster clock and ens5f1 synchronizes connected devices.
      2Required phc2sysOpts values. -m prints messages to stdout. The linuxptp-daemon DaemonSet parses the logs and generates Prometheus metrics.
    2. Create boundary-clock-ptp-config-nic2.yaml, removing the phc2sysOpts field altogether to disable the phc2sys service for the second NIC:

      1. apiVersion: ptp.openshift.io/v1
      2. kind: PtpConfig
      3. metadata:
      4. name: boundary-clock-ptp-config-nic2
      5. namespace: openshift-ptp
      6. spec:
      7. profile:
      8. - name: "profile2"
      9. ptp4lOpts: "-2 --summary_interval -4"
      10. ptp4lConf: | (1)
      11. [ens7f1]
      12. masterOnly 1
      13. [ens7f0]
      14. masterOnly 0
      15. ...
      1Specify the required interfaces to start ptp4l as a boundary clock on the second NIC.

      You must completely remove the phc2sysOpts field from the second PtpConfig CR to disable the phc2sys service on the second NIC.

  2. Create the dual NIC PtpConfig CRs by running the following commands:

    1. Create the CR that configures PTP for the first NIC:

      1. $ oc create -f boundary-clock-ptp-config-nic1.yaml
    2. Create the CR that configures PTP for the second NIC:

      1. $ oc create -f boundary-clock-ptp-config-nic2.yaml

Verification

  • Check that the PTP Operator has applied the PtpConfig CRs for both NICs. Examine the logs for the linuxptp daemon corresponding to the node that has the dual NIC hardware installed. For example, run the following command:

    1. $ oc logs linuxptp-daemon-cvgr6 -n openshift-ptp -c linuxptp-daemon-container

    Example output

    1. ptp4l[80828.335]: [ptp4l.1.config] master offset 5 s2 freq -5727 path delay 519
    2. ptp4l[80828.343]: [ptp4l.0.config] master offset -5 s2 freq -10607 path delay 533
    3. phc2sys[80828.390]: [ptp4l.0.config] CLOCK_REALTIME phc offset 1 s2 freq -87239 delay 539

Configuring linuxptp services as an ordinary clock

You can configure linuxptp services (ptp4l, phc2sys) as ordinary clock by creating a PtpConfig custom resource (CR) object.

Use the following example PtpConfig CR as the basis to configure linuxptp services as an ordinary clock for your particular hardware and environment. This example CR does not configure PTP fast events. To configure PTP fast events, set appropriate values for ptp4lOpts, ptp4lConf, and ptpClockThreshold. ptpClockThreshold is required only when events are enabled. See “Configuring the PTP fast event notifications publisher” for more information.

Prerequisites

  • Install the OpenShift CLI (oc).

  • Log in as a user with cluster-admin privileges.

  • Install the PTP Operator.

Procedure

  1. Create the following PtpConfig CR, and then save the YAML in the ordinary-clock-ptp-config.yaml file.

    Example PTP ordinary clock configuration

    1. apiVersion: ptp.openshift.io/v1
    2. kind: PtpConfig
    3. metadata:
    4. name: ordinary-clock
    5. namespace: openshift-ptp
    6. annotations: {}
    7. spec:
    8. profile:
    9. - name: ordinary-clock
    10. # The interface name is hardware-specific
    11. interface: $interface
    12. ptp4lOpts: "-2 -s"
    13. phc2sysOpts: "-a -r -n 24"
    14. ptpSchedulingPolicy: SCHED_FIFO
    15. ptpSchedulingPriority: 10
    16. ptpSettings:
    17. logReduce: "true"
    18. ptp4lConf: |
    19. [global]
    20. #
    21. # Default Data Set
    22. #
    23. twoStepFlag 1
    24. slaveOnly 1
    25. priority1 128
    26. priority2 128
    27. domainNumber 24
    28. #utc_offset 37
    29. clockClass 255
    30. clockAccuracy 0xFE
    31. offsetScaledLogVariance 0xFFFF
    32. free_running 0
    33. freq_est_interval 1
    34. dscp_event 0
    35. dscp_general 0
    36. dataset_comparison G.8275.x
    37. G.8275.defaultDS.localPriority 128
    38. #
    39. # Port Data Set
    40. #
    41. logAnnounceInterval -3
    42. logSyncInterval -4
    43. logMinDelayReqInterval -4
    44. logMinPdelayReqInterval -4
    45. announceReceiptTimeout 3
    46. syncReceiptTimeout 0
    47. delayAsymmetry 0
    48. fault_reset_interval -4
    49. neighborPropDelayThresh 20000000
    50. masterOnly 0
    51. G.8275.portDS.localPriority 128
    52. #
    53. # Run time options
    54. #
    55. assume_two_step 0
    56. logging_level 6
    57. path_trace_enabled 0
    58. follow_up_info 0
    59. hybrid_e2e 0
    60. inhibit_multicast_service 0
    61. net_sync_monitor 0
    62. tc_spanning_tree 0
    63. tx_timestamp_timeout 50
    64. unicast_listen 0
    65. unicast_master_table 0
    66. unicast_req_duration 3600
    67. use_syslog 1
    68. verbose 0
    69. summary_interval 0
    70. kernel_leap 1
    71. check_fup_sync 0
    72. clock_class_threshold 7
    73. #
    74. # Servo Options
    75. #
    76. pi_proportional_const 0.0
    77. pi_integral_const 0.0
    78. pi_proportional_scale 0.0
    79. pi_proportional_exponent -0.3
    80. pi_proportional_norm_max 0.7
    81. pi_integral_scale 0.0
    82. pi_integral_exponent 0.4
    83. pi_integral_norm_max 0.3
    84. step_threshold 2.0
    85. first_step_threshold 0.00002
    86. max_frequency 900000000
    87. clock_servo pi
    88. sanity_freq_limit 200000000
    89. ntpshm_segment 0
    90. #
    91. # Transport options
    92. #
    93. transportSpecific 0x0
    94. ptp_dst_mac 01:1B:19:00:00:00
    95. p2p_dst_mac 01:80:C2:00:00:0E
    96. udp_ttl 1
    97. udp6_scope 0x0E
    98. uds_address /var/run/ptp4l
    99. #
    100. # Default interface options
    101. #
    102. clock_type OC
    103. network_transport L2
    104. delay_mechanism E2E
    105. time_stamping hardware
    106. tsproc_mode filter
    107. delay_filter moving_median
    108. delay_filter_length 10
    109. egressLatency 0
    110. ingressLatency 0
    111. boundary_clock_jbod 0
    112. #
    113. # Clock description
    114. #
    115. productDescription ;;
    116. revisionData ;;
    117. manufacturerIdentity 00:00:00
    118. userDescription ;
    119. timeSource 0xA0
    120. recommend:
    121. - profile: ordinary-clock
    122. priority: 4
    123. match:
    124. - nodeLabel: "node-role.kubernetes.io/$mcp"
    Table 8. PTP ordinary clock CR configuration options
    CR fieldDescription

    name

    The name of the PtpConfig CR.

    profile

    Specify an array of one or more profile objects. Each profile must be uniquely named.

    interface

    Specify the network interface to be used by the ptp4l service, for example ens787f1.

    ptp4lOpts

    Specify system config options for the ptp4l service, for example -2 to select the IEEE 802.3 network transport. The options should not include the network interface name -i <interface> and service config file -f /etc/ptp4l.conf because the network interface name and the service config file are automatically appended. Append —summary_interval -4 to use PTP fast events with this interface.

    phc2sysOpts

    Specify system config options for the phc2sys service. If this field is empty, the PTP Operator does not start the phc2sys service. For Intel Columbiaville 800 Series NICs, set phc2sysOpts options to -a -r -m -n 24 -N 8 -R 16. -m prints messages to stdout. The linuxptp-daemon DaemonSet parses the logs and generates Prometheus metrics.

    ptp4lConf

    Specify a string that contains the configuration to replace the default /etc/ptp4l.conf file. To use the default configuration, leave the field empty.

    tx_timestamp_timeout

    For Intel Columbiaville 800 Series NICs, set tx_timestamp_timeout to 50.

    boundary_clock_jbod

    For Intel Columbiaville 800 Series NICs, set boundary_clock_jbod to 0.

    ptpSchedulingPolicy

    Scheduling policy for ptp4l and phc2sys processes. Default value is SCHED_OTHER. Use SCHED_FIFO on systems that support FIFO scheduling.

    ptpSchedulingPriority

    Integer value from 1-65 used to set FIFO priority for ptp4l and phc2sys processes when ptpSchedulingPolicy is set to SCHED_FIFO. The ptpSchedulingPriority field is not used when ptpSchedulingPolicy is set to SCHED_OTHER.

    ptpClockThreshold

    Optional. If ptpClockThreshold is not present, default values are used for the ptpClockThreshold fields. ptpClockThreshold configures how long after the PTP master clock is disconnected before PTP events are triggered. holdOverTimeout is the time value in seconds before the PTP clock event state changes to FREERUN when the PTP master clock is disconnected. The maxOffsetThreshold and minOffsetThreshold settings configure offset values in nanoseconds that compare against the values for CLOCK_REALTIME (phc2sys) or master offset (ptp4l). When the ptp4l or phc2sys offset value is outside this range, the PTP clock state is set to FREERUN. When the offset value is within this range, the PTP clock state is set to LOCKED.

    recommend

    Specify an array of one or more recommend objects that define rules on how the profile should be applied to nodes.

    .recommend.profile

    Specify the .recommend.profile object name defined in the profile section.

    .recommend.priority

    Set .recommend.priority to 0 for ordinary clock.

    .recommend.match

    Specify .recommend.match rules with nodeLabel or nodeName values.

    .recommend.match.nodeLabel

    Set nodeLabel with the key of the node.Labels field from the node object by using the oc get nodes —show-labels command. For example, node-role.kubernetes.io/worker.

    .recommend.match.nodeName

    Set nodeName with the value of the node.Name field from the node object by using the oc get nodes command. For example, compute-1.example.com.

  2. Create the PtpConfig CR by running the following command:

    1. $ oc create -f ordinary-clock-ptp-config.yaml

Verification

  1. Check that the PtpConfig profile is applied to the node.

    1. Get the list of pods in the openshift-ptp namespace by running the following command:

      1. $ oc get pods -n openshift-ptp -o wide

      Example output

      1. NAME READY STATUS RESTARTS AGE IP NODE
      2. linuxptp-daemon-4xkbb 1/1 Running 0 43m 10.1.196.24 compute-0.example.com
      3. linuxptp-daemon-tdspf 1/1 Running 0 43m 10.1.196.25 compute-1.example.com
      4. ptp-operator-657bbb64c8-2f8sj 1/1 Running 0 43m 10.129.0.61 control-plane-1.example.com
    2. Check that the profile is correct. Examine the logs of the linuxptp daemon that corresponds to the node you specified in the PtpConfig profile. Run the following command:

      1. $ oc logs linuxptp-daemon-4xkbb -n openshift-ptp -c linuxptp-daemon-container

      Example output

      1. I1115 09:41:17.117596 4143292 daemon.go:107] in applyNodePTPProfile
      2. I1115 09:41:17.117604 4143292 daemon.go:109] updating NodePTPProfile to:
      3. I1115 09:41:17.117607 4143292 daemon.go:110] ------------------------------------
      4. I1115 09:41:17.117612 4143292 daemon.go:102] Profile Name: profile1
      5. I1115 09:41:17.117616 4143292 daemon.go:102] Interface: ens787f1
      6. I1115 09:41:17.117620 4143292 daemon.go:102] Ptp4lOpts: -2 -s
      7. I1115 09:41:17.117623 4143292 daemon.go:102] Phc2sysOpts: -a -r -n 24
      8. I1115 09:41:17.117626 4143292 daemon.go:116] ------------------------------------

Additional resources

Intel Columbiaville E800 series NIC as PTP ordinary clock reference

The following table describes the changes that you must make to the reference PTP configuration to use Intel Columbiaville E800 series NICs as ordinary clocks. Make the changes in a PtpConfig custom resource (CR) that you apply to the cluster.

Table 9. Recommended PTP settings for Intel Columbiaville NIC
PTP configurationRecommended setting

phc2sysOpts

-a -r -m -n 24 -N 8 -R 16

tx_timestamp_timeout

50

boundary_clock_jbod

0

For phc2sysOpts, -m prints messages to stdout. The linuxptp-daemon DaemonSet parses the logs and generates Prometheus metrics.

Additional resources

Configuring FIFO priority scheduling for PTP hardware

In telco or other deployment types that require low latency performance, PTP daemon threads run in a constrained CPU footprint alongside the rest of the infrastructure components. By default, PTP threads run with the SCHED_OTHER policy. Under high load, these threads might not get the scheduling latency they require for error-free operation.

To mitigate against potential scheduling latency errors, you can configure the PTP Operator linuxptp services to allow threads to run with a SCHED_FIFO policy. If SCHED_FIFO is set for a PtpConfig CR, then ptp4l and phc2sys will run in the parent container under chrt with a priority set by the ptpSchedulingPriority field of the PtpConfig CR.

Setting ptpSchedulingPolicy is optional, and is only required if you are experiencing latency errors.

Procedure

  1. Edit the PtpConfig CR profile:

    1. $ oc edit PtpConfig -n openshift-ptp
  2. Change the ptpSchedulingPolicy and ptpSchedulingPriority fields:

    1. apiVersion: ptp.openshift.io/v1
    2. kind: PtpConfig
    3. metadata:
    4. name: <ptp_config_name>
    5. namespace: openshift-ptp
    6. ...
    7. spec:
    8. profile:
    9. - name: "profile1"
    10. ...
    11. ptpSchedulingPolicy: SCHED_FIFO (1)
    12. ptpSchedulingPriority: 10 (2)
    1Scheduling policy for ptp4l and phc2sys processes. Use SCHED_FIFO on systems that support FIFO scheduling.
    2Required. Sets the integer value 1-65 used to configure FIFO priority for ptp4l and phc2sys processes.
  3. Save and exit to apply the changes to the PtpConfig CR.

Verification

  1. Get the name of the linuxptp-daemon pod and corresponding node where the PtpConfig CR has been applied:

    1. $ oc get pods -n openshift-ptp -o wide

    Example output

    1. NAME READY STATUS RESTARTS AGE IP NODE
    2. linuxptp-daemon-gmv2n 3/3 Running 0 1d17h 10.1.196.24 compute-0.example.com
    3. linuxptp-daemon-lgm55 3/3 Running 0 1d17h 10.1.196.25 compute-1.example.com
    4. ptp-operator-3r4dcvf7f4-zndk7 1/1 Running 0 1d7h 10.129.0.61 control-plane-1.example.com
  2. Check that the ptp4l process is running with the updated chrt FIFO priority:

    1. $ oc -n openshift-ptp logs linuxptp-daemon-lgm55 -c linuxptp-daemon-container|grep chrt

    Example output

    1. I1216 19:24:57.091872 1600715 daemon.go:285] /bin/chrt -f 65 /usr/sbin/ptp4l -f /var/run/ptp4l.0.config -2 --summary_interval -4 -m

Configuring log filtering for linuxptp services

The linuxptp daemon generates logs that you can use for debugging purposes. In telco or other deployment types that feature a limited storage capacity, these logs can add to the storage demand.

To reduce the number log messages, you can configure the PtpConfig custom resource (CR) to exclude log messages that report the master offset value. The master offset log message reports the difference between the current node’s clock and the master clock in nanoseconds.

Prerequisites

  • Install the OpenShift CLI (oc).

  • Log in as a user with cluster-admin privileges.

  • Install the PTP Operator.

Procedure

  1. Edit the PtpConfig CR:

    1. $ oc edit PtpConfig -n openshift-ptp
  2. In spec.profile, add the ptpSettings.logReduce specification and set the value to true:

    1. apiVersion: ptp.openshift.io/v1
    2. kind: PtpConfig
    3. metadata:
    4. name: <ptp_config_name>
    5. namespace: openshift-ptp
    6. ...
    7. spec:
    8. profile:
    9. - name: "profile1"
    10. ...
    11. ptpSettings:
    12. logReduce: "true"

    For debugging purposes, you can revert this specification to False to include the master offset messages.

  3. Save and exit to apply the changes to the PtpConfig CR.

Verification

  1. Get the name of the linuxptp-daemon pod and corresponding node where the PtpConfig CR has been applied:

    1. $ oc get pods -n openshift-ptp -o wide

    Example output

    1. NAME READY STATUS RESTARTS AGE IP NODE
    2. linuxptp-daemon-gmv2n 3/3 Running 0 1d17h 10.1.196.24 compute-0.example.com
    3. linuxptp-daemon-lgm55 3/3 Running 0 1d17h 10.1.196.25 compute-1.example.com
    4. ptp-operator-3r4dcvf7f4-zndk7 1/1 Running 0 1d7h 10.129.0.61 control-plane-1.example.com
  2. Verify that master offset messages are excluded from the logs by running the following command:

    1. $ oc -n openshift-ptp logs <linux_daemon_container> -c linuxptp-daemon-container | grep "master offset" (1)
    1<linux_daemon_container> is the name of the linuxptp-daemon pod, for example linuxptp-daemon-gmv2n.

    When you configure the logReduce specification, this command does not report any instances of master offset in the logs of the linuxptp daemon.

Troubleshooting common PTP Operator issues

Troubleshoot common problems with the PTP Operator by performing the following steps.

Prerequisites

  • Install the OKD CLI (oc).

  • Log in as a user with cluster-admin privileges.

  • Install the PTP Operator on a bare-metal cluster with hosts that support PTP.

Procedure

  1. Check the Operator and operands are successfully deployed in the cluster for the configured nodes.

    1. $ oc get pods -n openshift-ptp -o wide

    Example output

    1. NAME READY STATUS RESTARTS AGE IP NODE
    2. linuxptp-daemon-lmvgn 3/3 Running 0 4d17h 10.1.196.24 compute-0.example.com
    3. linuxptp-daemon-qhfg7 3/3 Running 0 4d17h 10.1.196.25 compute-1.example.com
    4. ptp-operator-6b8dcbf7f4-zndk7 1/1 Running 0 5d7h 10.129.0.61 control-plane-1.example.com

    When the PTP fast event bus is enabled, the number of ready linuxptp-daemon pods is 3/3. If the PTP fast event bus is not enabled, 2/2 is displayed.

  2. Check that supported hardware is found in the cluster.

    1. $ oc -n openshift-ptp get nodeptpdevices.ptp.openshift.io

    Example output

    1. NAME AGE
    2. control-plane-0.example.com 10d
    3. control-plane-1.example.com 10d
    4. compute-0.example.com 10d
    5. compute-1.example.com 10d
    6. compute-2.example.com 10d
  3. Check the available PTP network interfaces for a node:

    1. $ oc -n openshift-ptp get nodeptpdevices.ptp.openshift.io <node_name> -o yaml

    where:

    <node_name>

    Specifies the node you want to query, for example, compute-0.example.com.

    Example output

    1. apiVersion: ptp.openshift.io/v1
    2. kind: NodePtpDevice
    3. metadata:
    4. creationTimestamp: "2021-09-14T16:52:33Z"
    5. generation: 1
    6. name: compute-0.example.com
    7. namespace: openshift-ptp
    8. resourceVersion: "177400"
    9. uid: 30413db0-4d8d-46da-9bef-737bacd548fd
    10. spec: {}
    11. status:
    12. devices:
    13. - name: eno1
    14. - name: eno2
    15. - name: eno3
    16. - name: eno4
    17. - name: enp5s0f0
    18. - name: enp5s0f1
  4. Check that the PTP interface is successfully synchronized to the primary clock by accessing the linuxptp-daemon pod for the corresponding node.

    1. Get the name of the linuxptp-daemon pod and corresponding node you want to troubleshoot by running the following command:

      1. $ oc get pods -n openshift-ptp -o wide

      Example output

      1. NAME READY STATUS RESTARTS AGE IP NODE
      2. linuxptp-daemon-lmvgn 3/3 Running 0 4d17h 10.1.196.24 compute-0.example.com
      3. linuxptp-daemon-qhfg7 3/3 Running 0 4d17h 10.1.196.25 compute-1.example.com
      4. ptp-operator-6b8dcbf7f4-zndk7 1/1 Running 0 5d7h 10.129.0.61 control-plane-1.example.com
    2. Remote shell into the required linuxptp-daemon container:

      1. $ oc rsh -n openshift-ptp -c linuxptp-daemon-container <linux_daemon_container>

      where:

      <linux_daemon_container>

      is the container you want to diagnose, for example linuxptp-daemon-lmvgn.

    3. In the remote shell connection to the linuxptp-daemon container, use the PTP Management Client (pmc) tool to diagnose the network interface. Run the following pmc command to check the sync status of the PTP device, for example ptp4l.

      1. # pmc -u -f /var/run/ptp4l.0.config -b 0 'GET PORT_DATA_SET'

      Example output when the node is successfully synced to the primary clock

      1. sending: GET PORT_DATA_SET
      2. 40a6b7.fffe.166ef0-1 seq 0 RESPONSE MANAGEMENT PORT_DATA_SET
      3. portIdentity 40a6b7.fffe.166ef0-1
      4. portState SLAVE
      5. logMinDelayReqInterval -4
      6. peerMeanPathDelay 0
      7. logAnnounceInterval -3
      8. announceReceiptTimeout 3
      9. logSyncInterval -4
      10. delayMechanism 1
      11. logMinPdelayReqInterval -4
      12. versionNumber 2
  5. For GNSS-sourced grandmaster clocks, verify that the in-tree NIC ice driver is correct by running the following command, for example:

    1. $ oc rsh -n openshift-ptp -c linuxptp-daemon-container linuxptp-daemon-74m2g ethtool -i ens7f0

    Example output

    1. driver: ice
    2. version: 5.14.0-356.bz2232515.el9.x86_64
    3. firmware-version: 4.20 0x8001778b 1.3346.0
  6. For GNSS-sourced grandmaster clocks, verify that the linuxptp-daemon container is receiving signal from the GNSS antenna. If the container is not receiving the GNSS signal, the /dev/gnss0 file is not populated. To verify, run the following command:

    1. $ oc rsh -n openshift-ptp -c linuxptp-daemon-container linuxptp-daemon-jnz6r cat /dev/gnss0

    Example output

    1. $GNRMC,125223.00,A,4233.24463,N,07126.64561,W,0.000,,300823,,,A,V*0A
    2. $GNVTG,,T,,M,0.000,N,0.000,K,A*3D
    3. $GNGGA,125223.00,4233.24463,N,07126.64561,W,1,12,99.99,98.6,M,-33.1,M,,*7E
    4. $GNGSA,A,3,25,17,19,11,12,06,05,04,09,20,,,99.99,99.99,99.99,1*37
    5. $GPGSV,3,1,10,04,12,039,41,05,31,222,46,06,50,064,48,09,28,064,42,1*62

Collecting PTP Operator data

You can use the oc adm must-gather command to collect information about your cluster, including features and objects associated with PTP Operator.

Prerequisites

  • You have access to the cluster as a user with the cluster-admin role.

  • You have installed the OpenShift CLI (oc).

  • You have installed the PTP Operator.

Procedure

  • To collect PTP Operator data with must-gather, you must specify the PTP Operator must-gather image.

    1. $ oc adm must-gather --image=registry.redhat.io/openshift4/ptp-must-gather-rhel8:v4