On Mon, May 17, 2021 at 10:02:59AM +0300, Amar Subramanyam via Linuxptp-devel wrote: > This patch addresses the following issues when ptp4l is run on multiple ports > with jbod and client only mode (i.e. clientOnly=1 and boundary_clock_jbod=1):- > > 1.The LISTENING port prints continuously > "selected best master clock 000000.0000.000003 > updating UTC offset to 37" > > We limited the log such that now it prints only when there is a > change in the best-master clock. > > 2.The port other than SLAVE (LISTENING port) prints an error > "port 1: master state recommended in slave only mode > ptp4l[1205469.356]: port 1: defaultDS.priority1 probably misconfigured" > for every ANNOUNCE RECEIPT Timeout.
I think it would be better to have separate patches for the two issues. > -static void clock_update_slave(struct clock *c) > +static void clock_update_slave(struct clock *c, int mdiff) > { > struct parentDS *pds = &c->dad.pds; > struct ptp_message *msg; > > - if (!c->best) > + if (!c->best || !mdiff) > return; Instead of adding and checking the mdiff parameter here, not doing anything, why not just not call the function? > diff --git a/port.c b/port.c > index 10bb9e1..650ca00 100644 > --- a/port.c > +++ b/port.c > @@ -2531,7 +2531,7 @@ void port_dispatch(struct port *p, enum fsm_event > event, int mdiff) > static void bc_dispatch(struct port *p, enum fsm_event event, int mdiff) > { > if (clock_slave_only(p->clock)) { > - if (event == EV_RS_MASTER || event == EV_RS_GRAND_MASTER) { > + if (event == EV_RS_GRAND_MASTER) { > port_slave_priority_warning(p); > } > } Makes sense to me. There is a comment in bmc_state_decision() referring to this code, which might need to be updated with this change, or maybe that whole check specific to the Automotive profile could be removed if the log message was the only reason for it (I'm not sure). Thanks, -- Miroslav Lichvar _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel