> -----Original Message-----
> From: Miroslav Lichvar <mlich...@redhat.com>
> Subject: Re: [Linuxptp-devel] [PATCH] phc2sys: Allow multiple sink clocks
> 
> On Tue, Jun 21, 2022 at 01:38:51PM +0200, Maciek Machnikowski wrote:
> > Currently, if the -c parameter is used multiple times only the last
> > clock will be synchronized and no error will be returned.
> >
> > This patch implements proper support for multiple -c parameter and
> > will synchronize all clocks to the selected source.
> 
> What are the advantages over running multiple instances of phc2sys?

That's the most significant benefit and it makes running PTP in containers
easier. Other than this - it enables single-instance monitoring with 
the --free-running added in the different patch.
 
> > Signed-off-by: Maciek Machnikowski <mac...@machnikowski.net>
> > ---
> >  phc2sys.c | 25 ++++++++++++++++++++-----
> >  1 file changed, 20 insertions(+), 5 deletions(-)
> 
> Please update the man page.

Will do

> 
> > @@ -1266,6 +1277,10 @@ int main(int argc, char *argv[])
> >
> >     if (!dst_name) {
> >             dst_name = "CLOCK_REALTIME";
> > +           r = phc2sys_static_dst_configuration(&priv, dst_name);
> > +           if (r) {
> > +                   goto end;
> > +           }
> >     }
> >     if (hardpps_configured(pps_fd) && strcmp(dst_name,
> "CLOCK_REALTIME")) {
> >             fprintf(stderr,
> 
> This check won't work if someone specifies -c /dev/ptp0 -c CLOCK_REALTIME.
> There should be a variable counting dst clocks and maybe dst_name could be
> renamed to last_dst_name to avoid confusion.

This checks if no -c parameter was specified (for the automatic mode). 
In such a case, it synchronizes the CLOCK_REALTIME by default,
and it'll still do that.

Regards
Maciek



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

Reply via email to