Commit d040a207 authored by Adam Wujek's avatar Adam Wujek 💬

servo: fix handling of picos_mu_prev

Because picos_mu_prev was not updated in the correct place, variable
n_err_delta_rtt was increased at every update. This resulted in errors
on the switch via SNMP.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 517a0a0a
......@@ -341,7 +341,6 @@ int wr_e2e_offset(struct pp_instance *ppi,
uint64_t delay_ms_fix;
TimeInternal ts_offset;
static int errcount;
int64_t picos_mu_prev = 0;
if(!s->t1.correct || !s->t2.correct ||
!s->t3.correct || !s->t4.correct) {
......@@ -372,7 +371,7 @@ int wr_e2e_offset(struct pp_instance *ppi,
dump_timestamp(ppi, "servo:t4", s->t4);
dump_timestamp(ppi, "->mdelay", s->mu);
}
picos_mu_prev = s->picos_mu;
s->picos_mu = ts_to_picos(s->mu);
big_delta_fix = s->delta_tx_m + s->delta_tx_s
+ s->delta_rx_m + s->delta_rx_s;
......@@ -416,6 +415,7 @@ int wr_servo_update(struct pp_instance *ppi)
/* shmem lock */
wrs_shm_write(ppsi_head, WRS_SHM_WRITE_BEGIN);
picos_mu_prev = s->picos_mu;
if (GLBS(ppi)->delay_mech == PP_P2P_MECH) {
if (!wr_p2p_offset(ppi, s, &ts_offset_hw))
goto out;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment