On Wed, Jul 20, 2022 at 12:06:43PM +0200, Jakub Raczyński wrote:
>  I was trying to setup gPTP using linuxptp (ptp4l + phc2sys) that would allow 
> two way synchronization using ntpd. Setup without ntpd (synchronizing 
> CLOCK_REALTIME) seems to be working perfectly. 
> However with ntpd is that when in network there is no external gPTP Master 
> available and device does become Master itself it may synchronize itself to 
> its own shm memory. 
> 
> 
>  phc2sys is run using: /usr/sbin/phc2sys -a -r -r -f /etc/ptp4l.cfg -E ntpshm 
> -M 4 

That is not expected to work. phc2sys has only one servo and ntpshm
can be used only in one direction.

You would need a second phc2sys instance with an option to only synchronize
the PHC, when the port is in master state.

As a workaround, you could write a script that would monitor the state
and start/stop phc2sys as needed.

>  While testing devices with gPTP we encountered, in my opinion, quite 
> inconsequential behavior. Using different setups, I set following flags and 
> had following outcome: 
> 
> 
>  gmCapable = 0 , slaveOnly = 0 -> OK 
>  gmCapable = 1 , slaveOnly = 0 -> OK 
>  gmCapable = 0 , slaveOnly = 1 -> Cannot mix 1588 slaveOnly with 802.1AS 
> !gmCapable 
>  gmCapable = 1 , slaveOnly = 1 -> OK 
> 
> 
>  Frankly, I would expect combination of "gmCapable = 1 , slaveOnly = 1" to 
> fail with than "gmCapable = 0 , slaveOnly = 1". 
> 
> 
> 
>  I would like to ask for reasoning behind that combination block and not the 
> other. Since SlaveOnly flag performs as expected, even for gPTP setup. 

I'm not sure. If slaveOnly is 1, the clock will not ever be a
grandmaster, i.e. not try to send sync messages. What would be
different with gmCapable of 0?

-- 
Miroslav Lichvar



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

Reply via email to