On Tue, Jun 14, 2022 at 06:17:51AM -0700, Vadim Fedorenko via Linuxptp-devel wrote: > After first timeout of Announce message ptp4l will send Announce > requests messages to all of configured non-master clock peers > without updating timeout on approval packet making huge unneeded > workload on servers. Fix it by updating announce timeout correctly.
> --- a/unicast_client.c > +++ b/unicast_client.c > @@ -467,6 +467,7 @@ void unicast_client_grant(struct port *p, struct > ptp_message *m, > ucma->granted |= 1 << mtype; > > switch (ucma->state) { > + case UC_HAVE_ANN: > case UC_WAIT: > if (mtype == ANNOUNCE) { > ucma->state = unicast_fsm(ucma->state, UC_EV_GRANT_ANN); The fix looks good to me. As an alternative or follow up cleanup patch, I think the identical unicast_client_set_renewal() calls from the different cases could be moved outside of the switch. The renewal needs to be updated on any grant. Ideally, each message type would have its own renewal, but I guess there is no reason for a server to give different durations for different types. > @@ -474,8 +475,6 @@ void unicast_client_grant(struct port *p, struct > ptp_message *m, > unicast_client_set_renewal(p, ucma, g->durationField); > } > break; > - case UC_HAVE_ANN: > - break; > case UC_NEED_SYDY: > switch (mtype) { > case DELAY_RESP: -- Miroslav Lichvar _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel