Just to add, the key reason it is not supported by BC is that if true, then
clockClass must be 255. This clockClass is only for slave-only OC.
>From IEEE1588-2019 clause 8.2.1.3.1.2:
If defaultDS.slaveOnly is TRUE, the initialization value [of
defaultDS.clockQuality.clockClass] shall be 255 as specified in 7.6.2.5.
>From IEEE1588-2019 Table 4:
255 | Shall be the clockClass of a slave-only PTP Instance
(see 9.2.2.1).
And clause 9.2.2.1 title is "Slave-Only Ordinary Clocks".
Greg
-----Original Message-----
From: Greg Armstrong
Sent: May 7, 2021 10:00 AM
To: Amar Subramanyam <[email protected]>; Miroslav Lichvar
<[email protected]>
Cc: [email protected]
Subject: RE: [Linuxptp-devel] [PATCH] Sync issues observed when ptp4l is ran
with jbod and client only mode (clientOnly=1 and boundary_clock_jbod=1)
One possible issue is you are setting clientOnly=1 for a BC; this is not
allowed per IEEE1588 (as a BC shall not be a slaveOnly PTP Instance).
>From IEEE1588-2019:
9.2.3 Non-slaveOnly PTP Instances
A Boundary Clock shall not be a slaveOnly PTP Instance. Ordinary Clocks
not designed or configured as slaveOnly and Boundary Clocks shall
implement the state machine illustrated in Figure 30.
Greg
-----Original Message-----
From: Amar Subramanyam via Linuxptp-devel <[email protected]>
Sent: May 7, 2021 7:37 AM
To: Miroslav Lichvar <[email protected]>
Cc: [email protected]
Subject: Re: [Linuxptp-devel] [PATCH] Sync issues observed when ptp4l is ran
with jbod and client only mode (clientOnly=1 and boundary_clock_jbod=1)
Hi Miroslav,
Please find our response in line.
Thanks,
Amar B S
-----Original Message-----
From: Miroslav Lichvar [mailto:[email protected]]
Sent: 06 May 2021 19:41
To: Amar Subramanyam <[email protected]>
Cc: [email protected]
Subject: Re: [Linuxptp-devel] [PATCH] Sync issues observed when ptp4l is ran
with jbod and client only mode (clientOnly=1 and boundary_clock_jbod=1)
CAUTION: This email originated from outside of Altiostar. Do not click on links
or open attachments unless you recognize the sender and you are sure the
content is safe. You will never be asked to reset your Altiostar password via
email.
On Tue, May 04, 2021 at 01:51:24PM +0300, Amar Subramanyam via Linuxptp-devel
wrote:
> This patch addresses the following issues when ptp4l is ran on
> multiple ports with jbod and client only mode (i.e clientOnly=1 and
> boundary_clock_jbod=1):-
>
> 1.SYNCHRONIZATION FAULT occurs at every ANNOUNCE RECEIPT Timeout on
> LISTENING port, which leads to PTP port state of SLAVE port to flap
> between SLAVE and UNCALIBRATED states continuously.
>> It's not clear to me what exactly is happening here and how does the patch
>> fix it. The faults are happening due to the clock check getting out of order
>> timestamps from two unsynchronized clocks, right? Any chance it is an issue
>> with phc2sys not synchronizing the clocks?
Please find the attached diagram, which details our use case. Two active grand
masters are connected to the same Telecom Slave Clock in two different ports,
PORT1 and PORT2. Single instance of Ptp4l and phc2sys are running in the
Telecom Slave Clock with boundary_clock_jbod=1 and clientOnly=1 configurations.
The expected behaviour here is ptp4l will take into account GM1 and GM2 and
choose the best master using BMCA algorithm. The port which has the best master
will be in SLAVE state while the other port will remain in LISTENING state,
acting as a redundant port.
Let GM1 be a better master than GM2, resulting in Port1 to be in SLAVE state
and Port2 in LISTENING state. While running the latest ptp4l, we are
observing the following issues, for which we have proposed our patch :-
Since Port 2 is in LISTENING state even though we are receving announce packets
from GM2, the function add_foreign_master() is called for every Announce
message received. Here, the announce receipt timer is not re-armed and hence
will trigger BMCA for every 375ms (Default Announce reciept timeout). This is
expected behaviour for normal client only mode with only 1 port but when
multiple client/slave ports are involved(say port1, port 2), we dont expect
port 2 to trigger BMCA unless there is a change in the Announce message
recevied from GM2.
Continuous BMCA triggering in port 2 causes a SYNCHRONIZATION FAULT in
port1.This causes port1 to jump from SLAVE to UNCALIBRATED and vice versa
repeatedly.
Hence, we are re-arming the Announce receipt timer in the function
add_foreign_master(), only when boundary_clock_jbod=1 and clientOnly=1 is
configured and atleast one port (Port1 here) is in SLAVE/UNCALIBRATED state.
> +int clock_get_client_state(struct clock *c) +{
> + struct port *piter;
> +
> + if (!clock_slave_only(c)) {
> + return 1;
> + }
> +
> + LIST_FOREACH(piter, &c->ports, list) {
> + enum port_state ps = port_state(piter);
> + if (ps == PS_SLAVE || ps == PS_UNCALIBRATED) {
> + return 0;
> + }
> + }
> + return 1;
> +}
> + * Inform if any of the port is in SLAVE state.
> + * @param c The clock instance.
> + * @return Return 0 if any port is in SLAVE state, 1 otherwise.
> + */
> +int clock_get_client_state(struct clock *c);
>> The function seems to be specific to the slave-only mode and it checks for
>> two port states. The description and name of the function indicate something
>> else.
Noted. Please find the updated description and function name below, we will
send out the modified patch after full review.
+ * Get port SLAVE state for client only mode.
+ * @param c The clock instance.
+ * @return Return 0 if any port is in SLAVE state, 1 otherwise.
+ */
+int clock_get_port_slave_state(struct clock *c);
> + * In multiport slave only mode, there maybe
> + * announce messages on LISTENING port. Re-arm
> + * the timer if any other configured port is in SLAVE state
> + */
> + if (p->jbod && !clock_get_client_state(p->clock)) {
> + port_set_announce_tmo(p);
> + }
>> Why is this and the other part of the port change specific to the jbod mode?
>> Shouldn't the announce timer work exactly the same no matter if it's a jbod
>> or a real multiport clock?
Please find the attached diagram, which details our use case. Two active grand
masters are connected to the same Telecom Slave Clock in two different ports,
PORT1 and PORT2. Single instance of Ptp4l and phc2sys are running in the
Telecom Slave Clock with boundary_clock_jbod=1 and clientOnly=1 configurations.
Let GM1 be a better master than GM2, resulting in Port1 to be in SLAVE state
and Port2 in LISTENING state.
When GM2 connection is lost or Announce messages are not received on port 2
(LISTENING port) , state decision event (BMCA algorithm) will be triggered. But
since the Port1 (SLAVE port) is still receiving the packets we dont expect to
trigger BMCA.
Hence, we are clearing the Announce receipt timer for port2 (LISTENING port) in
the function bc_event() upon Announce receipt timeout, only when
boundary_clock_jbod=1 and clientOnly=1 is configured and atleast one port
(Port1 here) is in SLAVE/UNCALIBRATED state.
--
Miroslav Lichvar
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel