On Thu, Jun 01, 2017 at 04:06:54PM +0000, Erik Hons wrote:
> These changes are:
> - Removed UNCALIBRATED and PRE_MASTER port states.
> - Short circuited foreign master qualification mechanism.
> - Correctly identify if the local PTP clock is the domain Grand Master.
> - port: Reduce the foreign master threshold for 802.1AS

If you offer four changes, then there should be four patches.

> diff --git a/fsm.c b/fsm.c
> index ce6efad..8bdf7c6 100644
> --- a/fsm.c
> +++ b/fsm.c
> @@ -18,6 +18,31 @@
>   */
> #include "fsm.h"
> +enum port_state gptp_fsm(enum port_state state, enum fsm_event event, int 
> mdiff)
> +{
> +             enum port_state next = ptp_fsm(state, event, mdiff);
> +
> +             switch (next) {
> +             case PS_UNCALIBRATED:
> +                             next = PS_SLAVE;
> +                             break;
> +             case PS_PRE_MASTER:
> +                             next = PS_MASTER;
> +                             break;
> +             case PS_INITIALIZING:
> +             case PS_FAULTY:
> +             case PS_DISABLED:
> +             case PS_LISTENING:
> +             case PS_MASTER:
> +             case PS_PASSIVE:
> +             case PS_SLAVE:
> +             case PS_GRAND_MASTER:
> +                             break;
> +             }
> +
> +             return next;
> +}

There are two things I dislike about this:

1. I prefer to have new FSMs in their own files.
   Please introduce a new C module, like fsm_gptp.c.

2. The "overloading" is a bit gross.  I would rather see the entire
   gPTP FSM by itself, despite the code duplication.  The code savings
   from overloading would be small, and the independence of the two
   algorithms is more important.  After all, the FSMs in the two
   standards are defined in totally different ways.

Thanks,
Richard


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to