slaveOnly and slave_event_monitor are kept for backward compatibility Signed-off-by: Yuval Kashtan <yuvalkash...@gmail.com> --- clock.c | 3 ++- config.c | 2 ++ configs/automotive-slave.cfg | 2 +- configs/default.cfg | 2 +- monitor.c | 9 +++++--- pmc.c | 4 ++-- port.c | 2 +- ptp4l.8 | 42 ++++++++++++++++++------------------ 8 files changed, 36 insertions(+), 30 deletions(-)
diff --git a/clock.c b/clock.c index 0156bc3..c6d0fac 100644 --- a/clock.c +++ b/clock.c @@ -955,7 +955,8 @@ struct clock *clock_create(enum clock_type type, struct config *config, c->dds.domainNumber = config_get_int(config, NULL, "domainNumber"); - if (config_get_int(config, NULL, "slaveOnly")) { + if (config_get_int(config, NULL, "slaveOnly") || + config_get_int(config, NULL, "workerOnly")) { c->dds.flags |= DDS_SLAVE_ONLY; } if (!config_get_int(config, NULL, "gmCapable") && diff --git a/config.c b/config.c index d237de9..32070fc 100644 --- a/config.c +++ b/config.c @@ -299,7 +299,9 @@ struct config_item config_tab[] = { GLOB_ITEM_INT("servo_num_offset_values", 10, 0, INT_MAX), GLOB_ITEM_INT("servo_offset_threshold", 0, 0, INT_MAX), GLOB_ITEM_STR("slave_event_monitor", ""), + GLOB_ITEM_STR("worker_event_monitor", ""), GLOB_ITEM_INT("slaveOnly", 0, 0, 1), + GLOB_ITEM_INT("workerOnly", 0, 0, 1), GLOB_ITEM_INT("socket_priority", 0, 0, 15), GLOB_ITEM_DBL("step_threshold", 0.0, 0.0, DBL_MAX), GLOB_ITEM_INT("summary_interval", 0, INT_MIN, INT_MAX), diff --git a/configs/automotive-slave.cfg b/configs/automotive-slave.cfg index 0898660..c7c7735 100644 --- a/configs/automotive-slave.cfg +++ b/configs/automotive-slave.cfg @@ -25,7 +25,7 @@ delay_mechanism P2P # Automotive Profile specific options # BMCA noop -slaveOnly 1 +workerOnly 1 inhibit_announce 1 asCapable true ignore_source_id 1 diff --git a/configs/default.cfg b/configs/default.cfg index 8c19129..c1b3a7c 100644 --- a/configs/default.cfg +++ b/configs/default.cfg @@ -3,7 +3,7 @@ # Default Data Set # twoStepFlag 1 -slaveOnly 0 +workerOnly 0 socket_priority 0 priority1 128 priority2 128 diff --git a/monitor.c b/monitor.c index ed451ac..8d0155e 100644 --- a/monitor.c +++ b/monitor.c @@ -126,10 +126,13 @@ struct monitor *monitor_create(struct config *config, struct port *dst) if (!monitor) { return NULL; } - path = config_get_string(config, NULL, "slave_event_monitor"); + path = config_get_string(config, NULL, "worker_event_monitor"); if (!path || !path[0]) { - /* Return an inactive monitor. */ - return monitor; + path = config_get_string(config, NULL, "slave_event_monitor"); + if (!path || !path[0]) { + /* Return an inactive monitor. */ + return monitor; + } } memset(&sa, 0, sizeof(sa)); sa.sun_family = AF_LOCAL; diff --git a/pmc.c b/pmc.c index 65d1d61..b67bbad 100644 --- a/pmc.c +++ b/pmc.c @@ -224,7 +224,7 @@ static void pmc_show(struct ptp_message *msg, FILE *fp) dds = (struct defaultDS *) mgt->data; fprintf(fp, "DEFAULT_DATA_SET " IFMT "twoStepFlag %d" - IFMT "slaveOnly %d" + IFMT "workerOnly %d" IFMT "numberPorts %hu" IFMT "priority1 %hhu" IFMT "clockClass %hhu" @@ -315,7 +315,7 @@ static void pmc_show(struct ptp_message *msg, FILE *fp) case TLV_SLAVE_ONLY: mtd = (struct management_tlv_datum *) mgt->data; fprintf(fp, "SLAVE_ONLY " - IFMT "slaveOnly %d", mtd->val & DDS_SLAVE_ONLY ? 1 : 0); + IFMT "workerOnly %d", mtd->val & DDS_SLAVE_ONLY ? 1 : 0); break; case TLV_CLOCK_ACCURACY: mtd = (struct management_tlv_datum *) mgt->data; diff --git a/port.c b/port.c index db3e9ac..f80cff8 100644 --- a/port.c +++ b/port.c @@ -3043,7 +3043,7 @@ struct port *port_open(const char *phc_device, } else if (clock_slave_only(clock)) { p->state_machine = designated_slave_fsm; } else { - pr_err("Please enable at least one of masterOnly or slaveOnly when BMCA == noop.\n"); + pr_err("Please enable at least one of masterOnly or workerOnly when BMCA == noop.\n"); goto err_port; } } else { diff --git a/ptp4l.8 b/ptp4l.8 index 473215b..eb3ef9b 100644 --- a/ptp4l.8 +++ b/ptp4l.8 @@ -78,7 +78,7 @@ associated with a network interface. This option specifies the PHC device (e.g. /dev/ptp0) to be used when running on legacy kernels. .TP .B \-s -Enable the slaveOnly mode. +Enable the workerOnly mode. .TP .BI \-l " print-level" Set the maximum syslog level of messages which should be printed or sent to @@ -99,11 +99,11 @@ Display a help message. .SH LONG OPTIONS Each and every configuration file option (see below) may also appear -as a "long" style command line argument. For example, the slaveOnly +as a "long" style command line argument. For example, the workerOnly option may be set using either of these two forms. .RS -\f(CW\-\-slaveOnly 1 \-\-slaveOnly=1\fP +\f(CW\-\-workerOnly 1 \-\-workerOnly=1\fP .RE Option values given on the command line override values in the global @@ -145,13 +145,13 @@ See UNICAST DISCOVERY OPTIONS, below. .TP .B delayAsymmetry The time difference in nanoseconds of the transmit and receive -paths. This value should be positive when the master-to-slave -propagation time is longer and negative when the slave-to-master time +paths. This value should be positive when the master-to-worker +propagation time is longer and negative when the worker-to-master time is longer. The default is 0 nanoseconds. .TP .B logAnnounceInterval The mean time interval between Announce messages. A shorter interval makes -ptp4l react faster to the changes in the master-slave hierarchy. The interval +ptp4l react faster to the changes in the master-worker hierarchy. The interval should be the same in the whole domain. It's specified as a power of two in seconds. The default is 1 (2 seconds). @@ -164,7 +164,7 @@ The default is 0 (1 second). .B operLogSyncInterval The Sync message interval to be requested once the clock enters the SERVO_LOCKED_STABLE state. If the 'msg_interval_request' option is -set, then the local slave port will request the remote master to +set, then the local worker port will request the remote master to switch to the given message rate via a signaling message containing a Message interval request TLV. This option is specified as a power of two in seconds, and default value is 0 (1 second). @@ -183,14 +183,14 @@ The default is 0 (1 second). .B operLogPdelayReqInterval The Pdelay Request messages interval to be used once the clock enters the SERVO_LOCKED_STABLE state. If the 'msg_interval_request' option -is set, then the local slave port will adopt this rate when the local +is set, then the local worker port will adopt this rate when the local clock enters the "locked stable" state. This option is specified as a power of two in seconds, and the default value is 0 (1 second). .TP .B inhibit_delay_req Don't send any delay requests. This will need the asCapable config option to be set to 'true'. This is useful when running as a designated master who does not -need to calculate offset from slave. The default is 0 (disabled). +need to calculate offset from worker. The default is 0 (disabled). .TP .B announceReceiptTimeout The number of missed Announce messages before the last Announce messages @@ -244,7 +244,7 @@ The default is E2E. .TP .B hybrid_e2e Enables the "hybrid" delay mechanism from the draft Enterprise -Profile. When enabled, ports in the slave state send their delay +Profile. When enabled, ports in the worker state send their delay request messages to the unicast address taken from the master's announce message. Ports in the master state will reply to unicast delay requests using unicast delay responses. This option has no @@ -380,8 +380,8 @@ Enable two-step mode for sync messages. One-step mode can be used only with hardware time stamping. The default is 1 (enabled). .TP -.B slaveOnly -The local clock is a slave-only clock if enabled. The default is 0 (disabled). +.B workerOnly / slaveOnly +The local clock is a worker-only clock if enabled. The default is 0 (disabled). .TP .B socket_priority Configure the SO_PRIORITY of sockets. This is to support cases where a user @@ -717,29 +717,29 @@ asCapable is initialized to 'false' and will be set to 'true' after the relevant checks have passed. The default value is 'auto'. .TP .B BMCA -This option enables use of static roles for master and slave devices instead of +This option enables use of static roles for master and worker devices instead of running the best master clock algorithm (BMCA) described in 1588 profile. This is useful when you know the roles of the devices in advance. When set to \'noop', the traditional BMCA algorithm used by 1588 is skipped. masterOnly and -slaveOnly will be used to determine master or slave role for the device. In a -bridge, slaveOnly (which is a global option) can be set to make all ports -assume the slave role. masterOnly (which is a per-port config option) can then +workerOnly will be used to determine master or worker role for the device. In a +bridge, workerOnly (which is a global option) can be set to make all ports +assume the worker role. masterOnly (which is a per-port config option) can then be used to set individual ports to take master role. BMCA is used in the -Automotive profile to speed up the start time for grand master and slaves. The +Automotive profile to speed up the start time for grand master and workers. The default value is 'ptp' which runs the BMCA related state machines. .TP .B inhibit_announce This will disable the timer for announce messages (i.e. FD_MANNO_TIMER) and also the announce message timeout timer (i.e. FD_ANNOUNCE_TIMER). This is used by the Automotive profile as part of switching over to a static BMCA. if this -option is enabled, ignore_source_id has to be enabled in the slave because it +option is enabled, ignore_source_id has to be enabled in the worker because it has no way to identify master identity in Sync and Follow_Up messages. The default is 0 (disabled). .TP .B ignore_source_id This will disable source port identity checking for Sync and Follow_Up messages. This is useful when the announce messages are disabled in the master -and the slave does not have any way to know it's identity. The default is 0 +and the worker does not have any way to know it's identity. The default is 0 (disabled). .TP .B msg_interval_request @@ -765,8 +765,8 @@ to the SERVO_LOCKED_STABLE state. The transition occurs once the last 'servo_num_offset_values' offsets are all below the threshold value. The default value of offset_threshold is 0 (disabled). .TP -.B slave_event_monitor -Specifies the address of a UNIX domain socket for slave event +.B worker_event_monitor / slave_event_monitor +Specifies the address of a UNIX domain socket for worker event monitoring. A local client bound to this address will receive SLAVE_RX_SYNC_TIMING_DATA and SLAVE_DELAY_TIMING_DATA_NP TLVs. The default is the empty string (disabled). -- 2.25.4 _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel