Skip to content

Commit 3fa13b7

Browse files
committed
updates for ptp operator plugin
1 parent 97ff8f8 commit 3fa13b7

5 files changed

+320
-4
lines changed

Diff for: modules/nw-ptp-configuring-linuxptp-services-as-grandmaster-clock.adoc

+7-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ The `ts2phc` utility allows you to synchronize the system clock with the PTP gra
1212

1313
[NOTE]
1414
====
15-
Use the following example `PtpConfig` CR as the basis to configure `linuxptp` services as the grandmaster clock for your particular hardware and environment.
16-
This example CR does not configure PTP fast events. To configure PTP fast events, set appropriate values for `ptp4lOpts`, `ptp4lConf`, and `ptpClockThreshold`.
15+
Use the following example `PtpConfig` CR as the basis to configure `linuxptp` services as the grandmaster clock for an Intel Westport Channel E810 network interface.
16+
To configure PTP fast events, set appropriate values for `ptp4lOpts`, `ptp4lConf`, and `ptpClockThreshold`.
1717
`ptpClockThreshold` is used only when events are enabled.
1818
See "Configuring the PTP fast event notifications publisher" for more information.
1919
====
@@ -34,7 +34,11 @@ See "Configuring the PTP fast event notifications publisher" for more informatio
3434

3535
.. Save the following YAML in the `grandmaster-clock-ptp-config.yaml` file:
3636
+
37-
include::snippets/grandmaster-clock-ptp-config.adoc[]
37+
.Recommended PTP grandmaster clock configuration
38+
[source,yaml]
39+
----
40+
include::snippets/ptp-PtpConfigGmWpc.yaml[]
41+
----
3842

3943
.. Create the CR by running the following command:
4044
+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/using-ptp.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="ptp-creating-hardware-specific-nic-plugins-for-ptp-operator_{context}"]
7+
= Creating hardware-specific NIC plugins for use with the PTP Operator
8+
9+
You can use hardware-specific NIC features with the PTP Operator by using specific hardware plugins in the `PtpConfig` custom resource (CR).
10+
11+
At a high level, the hardware plugin that you create does the following:
12+
13+
. Defines a set of Go structs and variables for the data types that you create
14+
15+
. Has a set of functions that configure the specific hardware based on values present in the `spec.profile.plugins` stanza of the `PtpCOnfig` custom resource (CR) that you deploy in the cluster
16+
17+
. TODO
18+
19+
[NOTE]
20+
====
21+
For {product-title} {product-version}, the PTP Operator provides a plugin for the Intel E810 Westport channel NIC card.
22+
====
23+
24+
// Only linuxptp-daemon needs PR?
25+
26+
// https://github.com/openshift/linuxptp-daemon/pull/143/files
27+
// https://github.com/openshift/linuxptp-daemon/blob/master/addons/intel/e810.go
28+
29+
.Prerequisites
30+
31+
* You have forked and cloned the link:https://github.com/openshift/linuxptp-daemon[linuxptp-daemon] repo.
32+
33+
* You have a list of specific NIC features that you want to configure.
34+
35+
.Procedure
36+
37+
. Open a shell prompt at the `/linuxptp-daemon` folder and create a new plugin folder for the NIC manufacturer under `/addons`. For example:
38+
+
39+
[source,terminal]
40+
----
41+
$ mkdir -p addons/intel
42+
----
43+
44+
. Create the configuration for the hardware plugin. For example, the following Go code defines a plugin for handling PTP configuration for Intel E810 Westport Channel NIC:
45+
+
46+
[source,go,subs="attributes+"]
47+
----
48+
include::https://raw.githubusercontent.com/openshift/linuxptp-daemon/release-{product-version}/addons/intel/e810.go[]
49+
----
50+
51+
.E810 plugin structs and variables
52+
[cols=2*, width="90%", options="header"]
53+
|====
54+
|Struct
55+
|Description
56+
57+
|`E810Opts`
58+
|Represents options for the E810 plugin, including boolean flags and a map of network device pins.
59+
60+
|`E810UblxCmds`
61+
|Represents configurations for `ubxtool` commands with a boolean flag and a slice of strings for command arguments.
62+
63+
|`E810PluginData`
64+
|Holds plugin-specific data used during plugin execution.
65+
66+
|`EnableE810PTPConfig`
67+
|Variable that has a script to configure pins on the NIC hardware.
68+
|====
69+
70+
.E810 plugin functions
71+
[cols=2*, width="90%", options="header"]
72+
|====
73+
|Function
74+
|Description
75+
76+
|`OnPTPConfigChangeE810`
77+
|Triggered when a change in the PTP configuration occurs. The function parses the plugin options and applies the required configurations to the network device pins based on the configuration data.
78+
79+
|`AfterRunPTPCommandE810`
80+
|Executed after running the `gpspipe` PTP command. It processes the plugin options and runs u-blox commands, storing the output in the plugin-specific data.
81+
82+
|`PopulateHwConfigE810`
83+
|Populates the hardware configuration data with E810-related information and status based on the plugin-specific data.
84+
85+
|`E810`
86+
|Creates and returns an instance of the E810 plugin. It registers the plugin with the required event handlers and initializes the plugin-specific data.
87+
|====
88+
89+
. Commit your changes and have your pull request reviewed and merged.
90+
91+
. ...
92+
93+
//How does the PR get merged, and how does the linuxptp daemon get into the PTP Operator? Does the customer have to use a custom version of the PTP Operator?
94+
95+
.Verification
96+
//Provide the user with verification methods for the procedure, such as expected output or commands that confirm success or failure.
97+
98+
Verify that your custom plugin has been deployed in the PTP Operator and the NIC hardware has been configured.
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/using-ptp.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="ptp-using-hardware-specific-nic-features_{context}"]
7+
= Using hardware-specific NIC features with the PTP Operator
8+
9+
NIC hardware with built-in PTP capabilities sometimes require device-specific configuration.
10+
You can use hardware-specific NIC features for supported hardware with the PTP Operator by configuring a plugin in the `PtpConfig` custom resource (CR).
11+
The `linuxptp-daemon` uses the named parameters in the `plugin` stanza to start `linuxptp` processes (`ptp4l` and `phc2sys`) based on the specific hardware configuration.
12+
13+
[IMPORTANT]
14+
====
15+
In {product-title} {product-version}, the Intel E810 NIC is supported with a `PtpConfig` plugin. No other NIC plugins are supported.
16+
====

Diff for: networking/using-ptp.adoc

+7-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ include::modules/nw-ptp-installing-operator-cli.adoc[leveloffset=+1]
3939

4040
include::modules/nw-ptp-installing-operator-web-console.adoc[leveloffset=+1]
4141

42+
[id="configuring-ptp-hardware"]
4243
== Configuring PTP devices
4344

4445
The PTP Operator adds the `NodePtpDevice.ptp.openshift.io` custom resource definition (CRD) to {product-title}.
@@ -47,6 +48,10 @@ When installed, the PTP Operator searches your cluster for PTP-capable network d
4748

4849
include::modules/nw-ptp-device-discovery.adoc[leveloffset=+2]
4950

51+
include::modules/ptp-using-hardware-specific-nic-features.adoc[leveloffset=+2]
52+
53+
include::modules/ptp-creating-hardware-specific-nic-plugins-for-ptp-operator.adoc[leveloffset=+3]
54+
5055
include::modules/nw-ptp-configuring-linuxptp-services-as-grandmaster-clock.adoc[leveloffset=+2]
5156

5257
[role="_additional-resources"]
@@ -89,6 +94,7 @@ include::modules/cnf-configuring-log-filtering-for-linuxptp.adoc[leveloffset=+2]
8994

9095
include::modules/cnf-troubleshooting-common-ptp-operator-issues.adoc[leveloffset=+1]
9196

97+
[id="ptp-hardware-fast-event-notifications-framework"]
9298
== PTP hardware fast event notifications framework
9399

94100
Cloud native applications such as virtual RAN (vRAN) require access to notifications about hardware timing events that are critical to the functioning of the overall network.
@@ -118,4 +124,4 @@ include::modules/cnf-monitoring-fast-events-metrics.adoc[leveloffset=+2]
118124
[role="_additional-resources"]
119125
.Additional resources
120126

121-
* xref:../monitoring/managing-metrics.adoc[Managing metrics]
127+
* xref:../monitoring/managing-metrics.adoc#managing-metrics[Managing metrics]

Diff for: snippets/ptp-PtpConfigGmWpc.yaml

+192
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
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+
pins:
19+
"ens2f1":
20+
"U.FL2": "0 2"
21+
"U.FL1": "0 1"
22+
"SMA2": "0 2"
23+
"SMA1": "0 1"
24+
ublxCmds:
25+
- args:
26+
- "-P"
27+
- "29.20"
28+
- "-z"
29+
- "CFG-HW-ANT_CFG_VOLTCTRL,1"
30+
reportOutput: false
31+
- args:
32+
- "-P"
33+
- "29.20"
34+
- "-e"
35+
- "GPS"
36+
reportOutput: false
37+
- args:
38+
- "-P"
39+
- "29.20"
40+
- "-e"
41+
- "Galileo"
42+
reportOutput: false
43+
- args:
44+
- "-P"
45+
- "29.20"
46+
- "-d"
47+
- "GLONASS"
48+
reportOutput: false
49+
- args:
50+
- "-P"
51+
- "29.20"
52+
- "-d"
53+
- "BeiDou"
54+
reportOutput: false
55+
- args:
56+
- "-P"
57+
- "29.20"
58+
- "-d"
59+
- "SBAS"
60+
reportOutput: false
61+
- args:
62+
- "-p"
63+
- "MON-HW"
64+
reportOutput: true
65+
ts2phcOpts: " "
66+
ts2phcConf: |
67+
[nmea]
68+
ts2phc.master 1
69+
[global]
70+
use_syslog 0
71+
verbose 1
72+
logging_level 7
73+
ts2phc.pulsewidth 100000000
74+
#GNSS module - ls /dev/gnss* -al
75+
ts2phc.nmea_serialport /dev/gnss0
76+
leapfile /usr/share/zoneinfo/leap-seconds.list
77+
[ens2f1]
78+
ts2phc.extts_polarity rising
79+
ts2phc.extts_correction 0
80+
ptp4lConf: |
81+
[ens2f1]
82+
masterOnly 1
83+
[ens2f2]
84+
masterOnly 1
85+
[ens2f3]
86+
masterOnly 1
87+
[ens2f3]
88+
masterOnly 1
89+
[global]
90+
#
91+
# Default Data Set
92+
#
93+
twoStepFlag 1
94+
priority1 128
95+
priority2 128
96+
domainNumber 24
97+
#utc_offset 37
98+
clockClass 6
99+
clockAccuracy 0x27
100+
offsetScaledLogVariance 0xFFFF
101+
free_running 0
102+
freq_est_interval 1
103+
dscp_event 0
104+
dscp_general 0
105+
dataset_comparison G.8275.x
106+
G.8275.defaultDS.localPriority 128
107+
#
108+
# Port Data Set
109+
#
110+
logAnnounceInterval -3
111+
logSyncInterval -4
112+
logMinDelayReqInterval -4
113+
logMinPdelayReqInterval 0
114+
announceReceiptTimeout 3
115+
syncReceiptTimeout 0
116+
delayAsymmetry 0
117+
fault_reset_interval -4
118+
neighborPropDelayThresh 20000000
119+
masterOnly 0
120+
G.8275.portDS.localPriority 128
121+
#
122+
# Run time options
123+
#
124+
assume_two_step 0
125+
logging_level 6
126+
path_trace_enabled 0
127+
follow_up_info 0
128+
hybrid_e2e 0
129+
inhibit_multicast_service 0
130+
net_sync_monitor 0
131+
tc_spanning_tree 0
132+
tx_timestamp_timeout 50
133+
unicast_listen 0
134+
unicast_master_table 0
135+
unicast_req_duration 3600
136+
use_syslog 1
137+
verbose 0
138+
summary_interval -4
139+
kernel_leap 1
140+
check_fup_sync 0
141+
clock_class_threshold 7
142+
#
143+
# Servo Options
144+
#
145+
pi_proportional_const 0.0
146+
pi_integral_const 0.0
147+
pi_proportional_scale 0.0
148+
pi_proportional_exponent -0.3
149+
pi_proportional_norm_max 0.7
150+
pi_integral_scale 0.0
151+
pi_integral_exponent 0.4
152+
pi_integral_norm_max 0.3
153+
step_threshold 2.0
154+
first_step_threshold 0.00002
155+
clock_servo pi
156+
sanity_freq_limit 200000000
157+
ntpshm_segment 0
158+
#
159+
# Transport options
160+
#
161+
transportSpecific 0x0
162+
ptp_dst_mac 01:1B:19:00:00:00
163+
p2p_dst_mac 01:80:C2:00:00:0E
164+
udp_ttl 1
165+
udp6_scope 0x0E
166+
uds_address /var/run/ptp4l
167+
#
168+
# Default interface options
169+
#
170+
clock_type BC
171+
network_transport L2
172+
delay_mechanism E2E
173+
time_stamping hardware
174+
tsproc_mode filter
175+
delay_filter moving_median
176+
delay_filter_length 10
177+
egressLatency 0
178+
ingressLatency 0
179+
boundary_clock_jbod 0
180+
#
181+
# Clock description
182+
#
183+
productDescription ;;
184+
revisionData ;;
185+
manufacturerIdentity 00:00:00
186+
userDescription ;
187+
timeSource 0x20
188+
recommend:
189+
- profile: "grandmaster"
190+
priority: 4
191+
match:
192+
- nodeLabel: "node-role.kubernetes.io/worker"

0 commit comments

Comments
 (0)