If a port goes down because of loss of link, ptp4l tries to avoid clearing the fault. However, if you set fault_reset_interval to ASAP, then ptp4l immediately clears the fault and tries to send and eventually gets a timeout.
Is this expected behavior? I feel like we might want to be checking the port link state to ensure that we don't clear the fault if link on the port is still down (since it will still be unusable). > int port_state_update(struct port *p, enum fsm_event event, int mdiff) > { > enum port_state next = p->state_machine(p->state, event, mdiff); > > if (PS_FAULTY == next) { > struct fault_interval i; > fault_interval(p, last_fault_type(p), &i); > if (clear_fault_asap(&i)) { > pr_notice("%s: clearing fault immediately", > p->log_name); > next = p->state_machine(next, EV_FAULT_CLEARED, 0); > } For context, I'm looking at this block > } > > if (PS_INITIALIZING == next) { > /* > * This is a special case. Since we initialize the > * port immediately, we can skip right to listening > * state if all goes well. > */ > if (port_is_enabled(p)) { > port_disable(p); > } > if (port_initialize(p)) { > event = EV_FAULT_DETECTED; > } else { > event = EV_INIT_COMPLETE; > } > next = p->state_machine(next, event, 0); > } > > if (mdiff) { > unicast_client_state_changed(p); > } > if (next != p->state) { > port_show_transition(p, next, event); > p->state = next; > port_notify_event(p, NOTIFY_PORT_STATE); > unicast_client_state_changed(p); > return 1; > } > > return 0; > } > the block where we issue a fault cleared normally is: > > /* > * When the fault timer expires we clear the fault, > * but only if the link is up. > */ > if (cur[N_POLLFD].revents & (POLLIN|POLLPRI)) { > clock_fault_timeout(p, 0); > if (port_link_status_get(p)) { > port_dispatch(p, EV_FAULT_CLEARED, 0); > } > } > We check port_link_status_get to determine if we still have link. It seems like we ought to check this when immediately clearing the fault too, no? In the setup I have, link goes down and we were using an immediate fault clear while attempting to debug issues with Tx timestamps (Yep, i know. ugh). Thanks, Jake _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel