phc2sys service start failed with error "autoconfiguration cannot be mixed with manual config options"

Bug #2048085 reported by Andre Mauricio Zelak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Andre Mauricio Zelak

Bug Description

Brief Description
-----------------

Using same phc2sys instance/interface configuration from previus STX versions the phc2sys service fails to start. The error message is: "autoconfiguration cannot be mixed with manual config options."

Severity
--------
Major

Steps to Reproduce
------------------
Configure the phc2sys instance as:

system ptp-instance-add phc0 phc2sys
system host-ptp-instance-assign controller-0 phc0
system ptp-interface-add phc0if1 phc0
system host-if-ptp-assign controller-0 enp81s0f1 phc0if1
system ptp-instance-parameter-add phc0 cmdline_opts='-a -r -R 2 -u 600' domainNumber=24 ptp4l-ptp01
system ptp-instance-apply

The configuration must have an PTP interface and the '-a' option in the command line.

Expected Behavior
------------------
The phc2sys starts ignoring the PTP interface given.

Actual Behavior
----------------
The phc2sys service fails to start.

Reproducibility
---------------
Always

System Configuration
--------------------
All

Branch/Pull Time/Commit
-----------------------
stx master since commit 2a6ddfe1b9700ce8e0c62da8a7a4f2edcd4e1cad

Last Pass
---------
stx 8.0

Timestamp/Logs
--------------
$ systemctl status phc2sys@*
* <email address hidden> - Synchronize system clock or PTP hardware clock (PHC)
     Loaded: loaded (/etc/systemd/system/phc2sys@.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Thu 2023-11-30 19:11:10 UTC; 4h 14min ago
    Process: 875095 ExecStart=/usr/sbin/phc2sys -f /etc/linuxptp/ptpinstance/phc2sys-phc0.conf $OPTIONS (code=exited, status=255/EXCEPTION)
    Process: 875096 ExecStartPost=/bin/bash -c echo $MAINPID > /var/run/phc2sys-phc0.pid (code=exited, status=0/SUCCESS)
    Process: 875097 ExecStopPost=/bin/rm -f /var/run/phc2sys-phc0.pid (code=exited, status=0/SUCCESS)
   Main PID: 875095 (code=exited, status=255/EXCEPTION)
        CPU: 3ms

$ cat /etc/default/ptpinstance/phc2sys-instance-phc0
OPTIONS="-a -r -R 2 -u 600 "

$ cat /etc/linuxptp/ptpinstance/phc2sys-phc0.conf
[global]
##
## Default Data Set
##
domainNumber 24
logging_level 7
message_tag phc0
uds_address /var/run/ptp4l-ptp01

[enp81s0f1]
##
## Associated interface: enp81s0f1
##

./phc2sys -a -r -R 2 -u 600 -f phc2sys-no-ha-single-clock-synce-w-iface.conf
autoconfiguration cannot be mixed with manual config options.

usage: phc2sys [options]

 automatic configuration:
 -a turn on autoconfiguration
 -r synchronize system (realtime) clock
                repeat -r to consider it also as a time source
 manual configuration:
 -c [dev|name] slave clock (CLOCK_REALTIME)
 -d [dev] master PPS device
 -s [dev|name] master clock
 -O [offset] slave-master time offset (0)
 -w wait for ptp4l
 common options:
 -f [file] configuration file
 -E [pi|linreg] clock servo (pi)
 -P [kp] proportional constant (0.7)
 -I [ki] integration constant (0.3)
 -S [step] step threshold (disabled)
 -F [step] step threshold only on start (0.00002)
 -R [rate] slave clock update rate in HZ (1.0)
 -N [num] number of master clock readings per update (5)
 -L [limit] sanity frequency limit in ppb (200000000)
 -M [num] NTP SHM segment number (0)
 -D [num] fall back to default clock in automatic mode (1)
 -u [num] number of clock updates in summary stats (0)
 -n [num] domain number (0)
 -x apply leap seconds by servo instead of kernel
 -z [path] server address for UDS (/var/run/ptp4l)
 -l [num] set the logging level to 'num' (6)
 -t [tag] add tag to log messages
 -m print messages to stdout
 -q do not print messages to the syslog
 -v prints the software version and exits
 -h prints this message and exits

Test Activity
-------------
Developer Testing

Workaround
----------
Don't configure or remote the PTP interface configuration.

Changed in starlingx:
assignee: nobody → Andre Mauricio Zelak (azelak)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to integ (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/integ/+/904782

Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to integ (master)

Reviewed: https://review.opendev.org/c/starlingx/integ/+/904782
Committed: https://opendev.org/starlingx/integ/commit/9fb03e0f35ba0698abe9a7277bd2b8dd033bc188
Submitter: "Zuul (22348)"
Branch: master

commit 9fb03e0f35ba0698abe9a7277bd2b8dd033bc188
Author: Andre Mauricio Zelak <email address hidden>
Date: Thu Jan 4 15:10:04 2024 -0300

    Fix PTP configuration compatibility

    Fixed the behavior when HA is disabled, one interface has been
    configured and '-a' autoconfiguration option is enabled in a
    phc2sys instance. The behavior before HA feature was to ignore
    the given interface. To keep compatibility with earlier
    configurations, interfaces in the configuration file are
    ignored if HA is disabled.

    Test Plan: non HA
    PASS: Verify behavior when HA is disabled and interface has been
    configured.
    PASS: Verify behavior when HA is ommited and interface has been
    configured.
    PASS: Verify behavior when HA is disabled and no interface has
    been configured.

    Test Plan: HA
    PASS: Verify phc2sys exit with error when HA is enabled and
    one interface has been configured.

    Test Plan: Build
    PASS: Verify patch application and package build

    Closes-bug: 2048085

    Change-Id: Ia65c157cfd63b637bd3ae3d7e370407e82371305
    Signed-off-by: Andre Mauricio Zelak <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Medium
tags: added: stx.9.0 stx.networking
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.