Re: [Linuxptp-devel] [PATCHv2 7/9] port.c: fix port_dispatch event flood when change ts_iface info
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: Hangbin L. <liu...@gm...> - 2017-08-09 10:38:04
|
On Sat, Aug 05, 2017 at 10:13:07AM +0200, Richard Cochran wrote: > > enum fsm_event port_event(struct port *p, int fd_index) > > @@ -2301,7 +2313,7 @@ enum fsm_event port_event(struct port *p, int fd_index) > > case FD_RTNL: > > pr_debug("port %hu: received link status notification", portnum(p)); > > rtnl_link_status(fd, port_link_status, p); > > - return port_link_status_get(p) ? EV_FAULT_CLEARED : EV_FAULT_DETECTED; > > + return EV_NONE; > > Maybe we can let rtnl_link_status() return the EV_ value from > port_link_status(), in order to keep a functional pattern and avoid > the hidden port_dispatch(). for ( ; NLMSG_OK(nh, len); nh = NLMSG_NEXT(nh, len)) { if (nh->nlmsg_type == RTM_NEWLINK) { cb(ctx, index, info->ifi_flags & IFF_RUNNING ? 1 : 0, device); } } One rtnl msg may have multi messages with nh->nlmsg_type == RTM_NEWLINK, which will call back port_link_status() multi times. So we could not let rtnl_link_status() return EV_ value. Thanks Hangbin |