Re: [Linuxptp-devel] Port down and sde

2021-05-04 Thread Luigi 'Comio' Mantellini
Hi Richard,

not a problem, of course. I'm just speaking about code cleanup.

luigi

Il giorno mar 4 mag 2021 alle ore 14:00 Richard Cochran <
richardcoch...@gmail.com> ha scritto:

> On Mon, May 03, 2021 at 06:45:56PM +0200, Luigi 'Comio' Mantellini wrote:
> > /*
> > * A port going down can affect the BMCA result.
> > * Force a state decision event.
> > */
> > if (p->link_status & LINK_DOWN)
> > clock_set_sde(p->clock, 1);
> >
> > I think that should be removed
>
> Why?  What problem does it cause?
>
> > because the calling code look like this:
> >
> > case FD_RTNL:
> > pr_debug("port %hu: received link status notification",
> portnum(p));
> > transport_rtnl_link_status(p->trp, fd, p->name,
> port_link_status, p);
> > if (p->link_status == (LINK_UP | LINK_STATE_CHANGED))
> > return EV_FAULT_CLEARED;
> > else if ((p->link_status == (LINK_DOWN | LINK_STATE_CHANGED)) ||
> >  (p->link_status & TS_LABEL_CHANGED))
> > return EV_FAULT_DETECTED;
> > else
> > return EV_NONE;
> >
> > raising a EV_FAULT_DETECT on LINK_DOWN
>
> So the SDE gets triggered twice?  Not really a problem.
>
> Thanks,
> Richard
>


-- 
*Luigi 'Comio' Mantellini*
My Professional Profile 

*"UNIX is very simple, it just needs a genius to understand its
simplicity." [cit.]*
___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] Port down and sde

2021-05-04 Thread Richard Cochran
On Mon, May 03, 2021 at 06:45:56PM +0200, Luigi 'Comio' Mantellini wrote:
> /*
> * A port going down can affect the BMCA result.
> * Force a state decision event.
> */
> if (p->link_status & LINK_DOWN)
> clock_set_sde(p->clock, 1);
> 
> I think that should be removed

Why?  What problem does it cause?

> because the calling code look like this:
> 
> case FD_RTNL:
> pr_debug("port %hu: received link status notification", portnum(p));
> transport_rtnl_link_status(p->trp, fd, p->name, port_link_status, p);
> if (p->link_status == (LINK_UP | LINK_STATE_CHANGED))
> return EV_FAULT_CLEARED;
> else if ((p->link_status == (LINK_DOWN | LINK_STATE_CHANGED)) ||
>  (p->link_status & TS_LABEL_CHANGED))
> return EV_FAULT_DETECTED;
> else
> return EV_NONE;
> 
> raising a EV_FAULT_DETECT on LINK_DOWN

So the SDE gets triggered twice?  Not really a problem.

Thanks,
Richard


___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


[Linuxptp-devel] Port down and sde

2021-05-03 Thread Luigi 'Comio' Mantellini
Hi Richard,
Hi All,

I noticed the following code inside port_link_status():

/*
* A port going down can affect the BMCA result.
* Force a state decision event.
*/
if (p->link_status & LINK_DOWN)
clock_set_sde(p->clock, 1);

I think that should be removed because the calling code look like this:

case FD_RTNL:
pr_debug("port %hu: received link status notification", portnum(p));
transport_rtnl_link_status(p->trp, fd, p->name, port_link_status, p);
if (p->link_status == (LINK_UP | LINK_STATE_CHANGED))
return EV_FAULT_CLEARED;
else if ((p->link_status == (LINK_DOWN | LINK_STATE_CHANGED)) ||
 (p->link_status & TS_LABEL_CHANGED))
return EV_FAULT_DETECTED;
else
return EV_NONE;

raising a EV_FAULT_DETECT on LINK_DOWN

Is my observation correct?

Thanks in advance.

luigi

-- 
Luigi 'Comio' Mantellini
My Professional Profile

"UNIX is very simple, it just needs a genius to understand its
simplicity." [cit.]


___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel