On Thu, Jul 28, 2016 at 09:21:20AM +0000, Jesuiter, Henry (ALC NetworX GmbH) wrote: > The most important advantage of this patch is its massive reduction of log > noise > if a PTP port loses its link for some reason.
I agree that the log noise can be annoying. However, this can be mitigated by increasing the fault reset interval, if your links are not reliable. > +enum fsm_event port_link_state(struct port* p) > +{ > + int link_status = sk_interface_link_state(p->name); > + > + if((link_status <= 0) && (port_state(p) != PS_DISABLED)) { > + /* either link down, or failure on getting link status */ > + pr_debug("port %hu: link down on %s", portnum(p), p->name); > + return EV_DESIGNATED_DISABLED; > + } > + > + if((link_status > 0) && (port_state(p) == PS_DISABLED)) { > + pr_debug("port %hu: link up on %s", portnum(p), p->name); > + return EV_DESIGNATED_ENABLED; > + } > + > + return EV_NONE; > +} This is not what EV_DESIGNATED_ are meant to be used for. They are for administrative purposes, using management messages. When the link goes down unexpectedly, this is a fault, and it should be treated as such. Currently, we do not detect that the reason for a fault is a downed link. The way to improve the code would be to expand the fault logic to handle a downed link explicitly. > Please note: as the commit message tells, that is a primitive method to > recognize the link status, > since it will poll for this information each time clock_poll() will be > called. Another (better) > solution could use the linux netlink socket infrastructure. If you prefer > such implementation > I could provide it as well. Don't bother. I already wrote a RT netlink module some years ago, but I never merged it because I thought the utility would be low. However, if this becomes an important feature that people want, then we can talk about adding it. So far, no one has really asked for this, and so I would like to hear convincing arguments why this feature is important... Thanks, Richard ------------------------------------------------------------------------------ _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel