Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2034785

Summary: ptpconfig with summary_interval cannot be applied
Product: OpenShift Container Platform Reporter: obochan <obochan>
Component: NetworkingAssignee: Joseph Richard <josricha>
Networking sub component: ptp QA Contact: obochan <obochan>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: unspecified CC: dacarpen, keyoung
Version: 4.10   
Target Milestone: ---   
Target Release: 4.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-10 16:36:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description obochan 2021-12-22 06:41:44 UTC
Description of problem:
When applied ptp configuration with summary_interval you get and error, and the configuration isn't applied.

Example of tested yaml.

apiVersion: ptp.openshift.io/v1
kind: PtpConfig
metadata:
  name: master
  namespace: openshift-ptp
spec:
  profile:
    - name: discovery-master
      interface: ens5f0
      ptp4lOpts: "-2 --summary_interval -4"
      phc2sysOpts: "-a -r -m -n 24 -N 8 -R 16"
      ptp4lConf: |
        [global]
        #
        # Default Data Set
        #
        twoStepFlag             1
        slaveOnly               0
        priority1               128
        priority2               128
        domainNumber            0
        #utc_offset             37
        clockClass              248
        clockAccuracy           0xFE
        offsetScaledLogVariance 0xFFFF
        free_running            0
        freq_est_interval       1
        dscp_event              0
        dscp_general            0
        dataset_comparison      ieee1588
        G.8275.defaultDS.localPriority  128
        #
        # Port Data Set
        #
        logAnnounceInterval     -3
        logSyncInterval          0
        logMinDelayReqInterval  -4
        logMinPdelayReqInterval -4
        announceReceiptTimeout  3
        syncReceiptTimeout      0
        delayAsymmetry          0
        fault_reset_interval    4
        neighborPropDelayThresh 20000000
        masterOnly              0
        G.8275.portDS.localPriority     128
        #
        # Run time options
        #
        assume_two_step         0
        logging_level           6
        path_trace_enabled      0
        follow_up_info          0
        hybrid_e2e              0
        inhibit_multicast_service       0
        net_sync_monitor        0
        tc_spanning_tree        0
        tx_timestamp_timeout    1
        unicast_listen          0
        unicast_master_table    0
        unicast_req_duration    3600
        use_syslog              1
        verbose                 0
        summary_interval        0
        kernel_leap             1
        check_fup_sync          0
        #
        # Servo Options
        #
        pi_proportional_const   0.0
        pi_integral_const       0.0
        pi_proportional_scale   0.0
        pi_proportional_exponent        -0.3
        pi_proportional_norm_max        0.7
        pi_integral_scale       0.0
        pi_integral_exponent    0.4
        pi_integral_norm_max    0.3
        step_threshold          0.0
        first_step_threshold    0.00002
        max_frequency           900000000
        clock_servo             pi
        sanity_freq_limit       200000000
        ntpshm_segment          0
        #
        # Transport options
        #
        transportSpecific       0x0
        ptp_dst_mac             01:1B:19:00:00:00
        p2p_dst_mac             01:80:C2:00:00:0E
        udp_ttl                 1
        udp6_scope              0x0E
        uds_address             /var/run/ptp4l
        #
        # Default interface options
        #
        clock_type              OC
        network_transport       UDPv4
        delay_mechanism         E2E
        time_stamping           hardware
        tsproc_mode             filter
        delay_filter            moving_median
        delay_filter_length     10
        egressLatency           0
        ingressLatency          0
        boundary_clock_jbod     0
        #
        # Clock description
        #
        productDescription      ;;
        revisionData            ;;
        manufacturerIdentity    00:00:00
        userDescription         ;
        timeSource              0xA0
  recommend:
    - profile: discovery-master
      priority: 5
      match:
        - nodeLabel: ptp/master

Version-Release number of selected component (if applicable):


How reproducible:

oc apply -f /home/obochan/Documents/PTP/ptpConfigMaster.yaml
Error from server (summary_interval -4 must match logSyncInterval 0): error when creating "/home/obochan/Documents/PTP/ptpConfigMaster.yaml": admission webhook "ptpconfigvalidationwebhook.openshift.io" denied the request: summary_interval -4 must match logSyncInterval 0

[obochan@obochan artifacts]$ oc get ptpconfigs.ptp.openshift.io -n openshift-ptp
No resources found in openshift-ptp namespace.

i have tried removing the log interval and changing to -4 and 0 but keep getting the same error.


Actual results:
Failed - to applied ptp configuration 

Expected results:
Pass - configuration should be applied.

Comment 1 or marziano 2021-12-22 09:33:12 UTC
https://github.com/openshift/ptp-operator/blob/953e3070a9665ab51e7c22b1e3d033d6cd0fad50/api/v1/ptpconfig_webhook.go#L111

It compares strings, so if you have some spaces it will think these are not the same numbers.

Comment 2 or marziano 2021-12-22 09:33:59 UTC
Error from server (summary_interval -4 must match logSyncInterval     -4): error when creating "ptpConfigOrdClock.yaml": admission webhook "ptpconfigvalidationwebhook.openshift.io" denied the request: summary_interval -4 must match logSyncInterval     -4

Comment 3 Joseph Richard 2021-12-22 18:10:06 UTC
It is intended behaviour to reject when summary_interval and logSyncInterval don't match.
I will update to remove extra whitespace characters, so it doesn't reject '         -4'.

Comment 4 obochan 2021-12-29 14:20:56 UTC
issue doesn't reproduce in version 

Server Version: 4.10.0-0.nightly-2021-12-21-130047
Kubernetes Version: v1.22.1+6859754


Please advise if the fix is included in this version

Comment 6 obochan 2022-01-20 08:33:15 UTC
issue is verified and was reproducible via version:

[obochan@obochan policygentemplates]$ oc get ptpconfigs.ptp.openshift.io -n openshift-ptp
NAME           AGE
du-ptp-slave   22h
master         2m1s

Server Version: 4.10.0-0.nightly-2021-12-14-122508
Kubernetes Version: v1.22.1+6859754

[obochan@obochan policygentemplates]$ oc apply -f /home/obochan/Documents/PTP/ptpConfigMaster.yaml
ptpconfig.ptp.openshift.io/master created
[obochan@obochan policygentemplates]$ cat /home/obochan/Documents/PTP/ptpConfigMaster.yaml
apiVersion: ptp.openshift.io/v1
kind: PtpConfig
metadata:
  name: master
  namespace: openshift-ptp
spec:
  profile:
    - name: discovery-master
      interface: ens5f1
      ptp4lOpts: "-2 --summary_interval -4"
      phc2sysOpts: "-a -r -m -n 24 -N 8 -R 16"
      ptp4lConf: |
        [global]
        #
        # Default Data Set
        #
        twoStepFlag             1
        slaveOnly               0
        priority1               128
        priority2               128
        domainNumber            0
        #utc_offset             37
        clockClass              248
        clockAccuracy           0xFE
        offsetScaledLogVariance 0xFFFF
        free_running            0
        freq_est_interval       1
        dscp_event              0
        dscp_general            0
        dataset_comparison      ieee1588
        G.8275.defaultDS.localPriority  128
        #
        # Port Data Set
        #
        logAnnounceInterval     -3
        logMinDelayReqInterval  -4
        logMinPdelayReqInterval -4
        logSyncInterval         -4
        announceReceiptTimeout  3
        syncReceiptTimeout      0
        delayAsymmetry          0
        fault_reset_interval    4
        neighborPropDelayThresh 20000000
        masterOnly              0
        G.8275.portDS.localPriority     128
        #
        # Run time options
        #
        assume_two_step         0
        logging_level           6
        path_trace_enabled      0
        follow_up_info          0
        hybrid_e2e              0
        inhibit_multicast_service       0
        net_sync_monitor        0
        tc_spanning_tree        0
        tx_timestamp_timeout    1
        unicast_listen          0
        unicast_master_table    0
        unicast_req_duration    3600
        use_syslog              1
        verbose                 0
        summary_interval        0
        kernel_leap             1
        check_fup_sync          0
        #
        # Servo Options
        #
        pi_proportional_const   0.0
        pi_integral_const       0.0
        pi_proportional_scale   0.0
        pi_proportional_exponent        -0.3
        pi_proportional_norm_max        0.7
        pi_integral_scale       0.0
        pi_integral_exponent    0.4
        pi_integral_norm_max    0.3
        step_threshold          0.0
        first_step_threshold    0.00002
        max_frequency           900000000
        clock_servo             pi
        sanity_freq_limit       200000000
        ntpshm_segment          0
        #
        # Transport options
        #
        transportSpecific       0x0
        ptp_dst_mac             01:1B:19:00:00:00
        p2p_dst_mac             01:80:C2:00:00:0E
        udp_ttl                 1
        udp6_scope              0x0E
        uds_address             /var/run/ptp4l
        #
        # Default interface options
        #
        clock_type              OC
        network_transport       UDPv4
        delay_mechanism         E2E
        time_stamping           hardware
        tsproc_mode             filter
        delay_filter            moving_median
        delay_filter_length     10
        egressLatency           0
        ingressLatency          0
        boundary_clock_jbod     0
        #
        # Clock description
        #
        productDescription      ;;
        revisionData            ;;
        manufacturerIdentity    00:00:00
        userDescription         ;
        timeSource              0xA0
        #ptpSchedulingPolicy SCHED_FIFO
        #ptpSchedulingPriority 65
  recommend:
    - profile: discovery-master
      priority: 5
      match:
        - nodeLabel: ptp/master
[obochan@obochan policygentemplates]$

Comment 7 obochan 2022-01-20 08:33:43 UTC
issue is verified and was reproducible via version:

[obochan@obochan policygentemplates]$ oc get ptpconfigs.ptp.openshift.io -n openshift-ptp
NAME           AGE
du-ptp-slave   22h
master         2m1s

Server Version: 4.10.0-0.nightly-2021-12-14-122508
Kubernetes Version: v1.22.1+6859754

[obochan@obochan policygentemplates]$ oc apply -f /home/obochan/Documents/PTP/ptpConfigMaster.yaml
ptpconfig.ptp.openshift.io/master created
[obochan@obochan policygentemplates]$ cat /home/obochan/Documents/PTP/ptpConfigMaster.yaml
apiVersion: ptp.openshift.io/v1
kind: PtpConfig
metadata:
  name: master
  namespace: openshift-ptp
spec:
  profile:
    - name: discovery-master
      interface: ens5f1
      ptp4lOpts: "-2 --summary_interval -4"
      phc2sysOpts: "-a -r -m -n 24 -N 8 -R 16"
      ptp4lConf: |
        [global]
        #
        # Default Data Set
        #
        twoStepFlag             1
        slaveOnly               0
        priority1               128
        priority2               128
        domainNumber            0
        #utc_offset             37
        clockClass              248
        clockAccuracy           0xFE
        offsetScaledLogVariance 0xFFFF
        free_running            0
        freq_est_interval       1
        dscp_event              0
        dscp_general            0
        dataset_comparison      ieee1588
        G.8275.defaultDS.localPriority  128
        #
        # Port Data Set
        #
        logAnnounceInterval     -3
        logMinDelayReqInterval  -4
        logMinPdelayReqInterval -4
        logSyncInterval         -4
        announceReceiptTimeout  3
        syncReceiptTimeout      0
        delayAsymmetry          0
        fault_reset_interval    4
        neighborPropDelayThresh 20000000
        masterOnly              0
        G.8275.portDS.localPriority     128
        #
        # Run time options
        #
        assume_two_step         0
        logging_level           6
        path_trace_enabled      0
        follow_up_info          0
        hybrid_e2e              0
        inhibit_multicast_service       0
        net_sync_monitor        0
        tc_spanning_tree        0
        tx_timestamp_timeout    1
        unicast_listen          0
        unicast_master_table    0
        unicast_req_duration    3600
        use_syslog              1
        verbose                 0
        summary_interval        0
        kernel_leap             1
        check_fup_sync          0
        #
        # Servo Options
        #
        pi_proportional_const   0.0
        pi_integral_const       0.0
        pi_proportional_scale   0.0
        pi_proportional_exponent        -0.3
        pi_proportional_norm_max        0.7
        pi_integral_scale       0.0
        pi_integral_exponent    0.4
        pi_integral_norm_max    0.3
        step_threshold          0.0
        first_step_threshold    0.00002
        max_frequency           900000000
        clock_servo             pi
        sanity_freq_limit       200000000
        ntpshm_segment          0
        #
        # Transport options
        #
        transportSpecific       0x0
        ptp_dst_mac             01:1B:19:00:00:00
        p2p_dst_mac             01:80:C2:00:00:0E
        udp_ttl                 1
        udp6_scope              0x0E
        uds_address             /var/run/ptp4l
        #
        # Default interface options
        #
        clock_type              OC
        network_transport       UDPv4
        delay_mechanism         E2E
        time_stamping           hardware
        tsproc_mode             filter
        delay_filter            moving_median
        delay_filter_length     10
        egressLatency           0
        ingressLatency          0
        boundary_clock_jbod     0
        #
        # Clock description
        #
        productDescription      ;;
        revisionData            ;;
        manufacturerIdentity    00:00:00
        userDescription         ;
        timeSource              0xA0
        #ptpSchedulingPolicy SCHED_FIFO
        #ptpSchedulingPriority 65
  recommend:
    - profile: discovery-master
      priority: 5
      match:
        - nodeLabel: ptp/master
[obochan@obochan policygentemplates]$

Comment 10 Darren Carpenter 2022-03-02 22:37:03 UTC
Have another incident of this in a 4.9 deployment. summary_interval is set to 6 and logSyncInterval is set to -4. Receiving the same error re: the webhook.

What problem/issue/behavior are you having trouble with?  What do you expect to see?
When using "summary_interval 6" in a PtpConfig the ptpconfigvalidationwebhook returns an error
=======================================================================
Error from server (summary_interval 6 must match logSyncInterval -4): error when creating "04-PtpConfigBC.yaml": admission webhook "ptpconfigvalidationwebhook.openshift.io" denied the request: summary_interval 6 must match logSyncInterval -4
=======================================================================
This is a perfectly valid configuration though. summary_interval does not at all have to match logSyncInterval according to the ptp4l manual page.

The PtpConfig file is the following:
=======================================================================
apiVersion: ptp.openshift.io/v1
kind: PtpConfig
metadata:
  name: boundary
  namespace: openshift-ptp
spec:
  profile:
  - name: "boundary"
    interface: ""
    ptp4lOpts: "-2 --summary_interval 6"

    phc2sysOpts: "-a -r -n 24"
    ptp4lConf: |
      [ens1f0]
      masterOnly 0
      [ens1f1]
      masterOnly 1
      [ens1f2]
      masterOnly 1
      [global]
      slaveOnly               0
      priority1 128
      domainNumber 24
      boundary_clock_jbod 1
      logAnnounceInterval -3
      delay_mechanism E2E
      network_transport L2
      tx_timestamp_timeout 50
      dataset_comparison G.8275.x
      time_stamping hardware
      clockClass 255
      logSyncInterval -4
      logMinDelayReqInterval -4
      fault_reset_interval 0
      priority2 128
      clock_servo linreg
  recommend:
  - profile: "boundary"
    priority: 4
    match:
    - nodeLabel: "node-role.kubernetes.io/master"

Comment 12 errata-xmlrpc 2022-03-10 16:36:03 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.10.3 security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:0056