> 20.07.2022 13:33 Miroslav Lichvar <mlich...@redhat.com> wrote:
> 
>  
> 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.

Best option would be if phc2sys could exist as Master-only (only '-r' flag 
without '-a -r'). Such case could probably only useful for ntpshm servo that 
can be used in Time Servers that use different sources of synchronization (like 
GPS + PTP in our case). But as you said, right now only option seems to be such 
workaround.

Maybe such option would be worthy TODO?

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

'gmCapable 0 + slaveOnly 0' does send Announce messages but from other Slave 
devices we can only see "master clock not ready, waiting..." and they are 
locked into LISTENING state, which is quite different.
So we were using 'slaveOnly 1' to not pollute network with excessive devices.

Anyway, thanks for the help.

Best regards
Jakub Raczynski


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

Reply via email to