Reset the master/local frequency estimator when changing masters.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
1bb8ebbdc5
commit
db36fb52ca
8
clock.c
8
clock.c
|
@ -117,6 +117,13 @@ static int clock_fault_timeout(struct clock *c, int index, int set)
|
||||||
return timerfd_settime(c->fault_fd[index], 0, &tmo, NULL);
|
return timerfd_settime(c->fault_fd[index], 0, &tmo, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void clock_freq_est_reset(struct clock *c)
|
||||||
|
{
|
||||||
|
c->fest.origin1 = tmv_zero();
|
||||||
|
c->fest.ingress1 = tmv_zero();
|
||||||
|
c->fest.count = 0;
|
||||||
|
};
|
||||||
|
|
||||||
static int clock_management_response(struct clock *c, struct port *p, int id,
|
static int clock_management_response(struct clock *c, struct port *p, int id,
|
||||||
struct ptp_message *req)
|
struct ptp_message *req)
|
||||||
{
|
{
|
||||||
|
@ -797,6 +804,7 @@ static void handle_state_decision_event(struct clock *c)
|
||||||
cid2str(&best->dataset.identity));
|
cid2str(&best->dataset.identity));
|
||||||
|
|
||||||
if (c->best != best) {
|
if (c->best != best) {
|
||||||
|
clock_freq_est_reset(c);
|
||||||
mave_reset(c->avg_delay);
|
mave_reset(c->avg_delay);
|
||||||
fresh_best = 1;
|
fresh_best = 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue