This option will accomplish 2 things. On the master, it will stop the
announce messages being sent (by disabling FD_MANNO_TIMER timer). On
slave, it will not configure announce message timeouts (by disabling
FD_ANNOUNCE_TIMEOUT timer).

This config option is needed for the AVnu Automotive profile[1]  as part
of skipping the Best Master Clock Algorithm (BMCA) as described in
Section 6.3 pt #1 (lines 191 to 195).

[1] - http://avnu.org/wp-content/uploads/2014/05/
      Automotive-Ethernet-AVB-Func-Interop-Spec-v1.5-Public.pdf

Signed-off-by: Vedang Patel <vedang.pa...@intel.com>
Change-Id: I6613ce54f7d37c942ea654e733fdb43c983d4f24
---
 config.c            |  1 +
 configs/default.cfg |  1 +
 port.c              | 13 +++++++++++--
 port_private.h      |  1 +
 ptp4l.8             |  8 ++++++++
 5 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/config.c b/config.c
index 47cad7ab6632..702ee1b4e52a 100644
--- a/config.c
+++ b/config.c
@@ -225,6 +225,7 @@ struct config_item config_tab[] = {
        PORT_ITEM_INT("hybrid_e2e", 0, 0, 1),
        PORT_ITEM_INT("ignore_transport_specific", 0, 0, 1),
        PORT_ITEM_INT("ingressLatency", 0, INT_MIN, INT_MAX),
+       PORT_ITEM_INT("inhibit_announce", 0, 0, 1),
        PORT_ITEM_INT("inhibit_multicast_service", 0, 0, 1),
        GLOB_ITEM_INT("initial_delay", 0, 0, INT_MAX),
        GLOB_ITEM_INT("kernel_leap", 1, 0, 1),
diff --git a/configs/default.cfg b/configs/default.cfg
index 02714150fbab..56dfbe4aace1 100644
--- a/configs/default.cfg
+++ b/configs/default.cfg
@@ -32,6 +32,7 @@ neighborPropDelayThresh       20000000
 masterOnly             0
 G.8275.portDS.localPriority    128
 BMCA                    ptp
+inhibit_announce        0
 #
 # Run time options
 #
diff --git a/port.c b/port.c
index 6144b1a05de5..dacc8d383607 100644
--- a/port.c
+++ b/port.c
@@ -1035,6 +1035,10 @@ static void port_nrate_initialize(struct port *p)
 
 int port_set_announce_tmo(struct port *p)
 {
+       if (p->inhibit_announce) {
+               return 0;
+       }
+
        return set_tmo_random(p->fda.fd[FD_ANNOUNCE_TIMER],
                              p->announceReceiptTimeout,
                              p->announce_span, p->logAnnounceInterval);
@@ -1588,6 +1592,7 @@ int port_initialize(struct port *p)
        p->logMinDelayReqInterval  = config_get_int(cfg, p->name, 
"logMinDelayReqInterval");
        p->peerMeanPathDelay       = 0;
        p->logAnnounceInterval     = config_get_int(cfg, p->name, 
"logAnnounceInterval");
+       p->inhibit_announce        = config_get_int(cfg, p->name, 
"inhibit_announce");
        p->announceReceiptTimeout  = config_get_int(cfg, p->name, 
"announceReceiptTimeout");
        p->syncReceiptTimeout      = config_get_int(cfg, p->name, 
"syncReceiptTimeout");
        p->transportSpecific       = config_get_int(cfg, p->name, 
"transportSpecific");
@@ -2295,7 +2300,9 @@ static void port_e2e_transition(struct port *p, enum 
port_state next)
                break;
        case PS_MASTER:
        case PS_GRAND_MASTER:
-               set_tmo_log(p->fda.fd[FD_MANNO_TIMER], 1, -10); /*~1ms*/
+               if (!p->inhibit_announce) {
+                       set_tmo_log(p->fda.fd[FD_MANNO_TIMER], 1, -10); /*~1ms*/
+               }
                port_set_sync_tx_tmo(p);
                break;
        case PS_PASSIVE:
@@ -2346,7 +2353,9 @@ static void port_p2p_transition(struct port *p, enum 
port_state next)
                if (p->bmca == BMCA_NOOP) {
                        port_set_delay_tmo(p);
                }
-               set_tmo_log(p->fda.fd[FD_MANNO_TIMER], 1, -10); /*~1ms*/
+               if (!p->inhibit_announce) {
+                       set_tmo_log(p->fda.fd[FD_MANNO_TIMER], 1, -10); /*~1ms*/
+               }
                port_set_sync_tx_tmo(p);
                break;
        case PS_PASSIVE:
diff --git a/port_private.h b/port_private.h
index 8b5525a2122a..b454901f208d 100644
--- a/port_private.h
+++ b/port_private.h
@@ -97,6 +97,7 @@ struct port {
        enum port_state (*state_machine)(enum port_state state,
                                         enum fsm_event event, int mdiff);
        int bmca;
+       int inhibit_announce;
        /* portDS */
        struct PortIdentity portIdentity;
        enum port_state     state; /*portState*/
diff --git a/ptp4l.8 b/ptp4l.8
index 8c19d1d276ee..24ba45342460 100644
--- a/ptp4l.8
+++ b/ptp4l.8
@@ -670,6 +670,14 @@ assume the slave role. masterOnly (which is a per-port 
config option) can then
 be used to set individual ports to take master role. BMCA is used in the AVnu
 Automotive profile to speed up the start time for grand master and slaves. The
 default value is 'ptp' which runs the BMCA related state machines.
+.TP
+.B inhibit_announce
+This will disable the timer for announce messages (i.e. FD_MANNO_TIMER) and
+also the announce message timeout timer (i.e. FD_ANNOUNCE_TIMER). This is used
+by the AVnu Automotive profile as part of switching over to a static BMCA. if
+this option is enabled, ignore_source_id has to be enabled in the slave because
+it has no way to identify master identity in Sync and Follow_Up messages. The
+default is 0 (disabled).
 
 .SH UNICAST DISCOVERY OPTIONS
 
-- 
2.7.3


------------------------------------------------------------------------------
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
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to