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?

> +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.

> +      * 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?

-- 
Miroslav Lichvar



_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to