Add provision to disable delay requests. Designated masters who do not
need to calculate delay can use this option. This is required by
Automotive Profile to reduce network load.

Signed-off-by: Vedang Patel <[email protected]>
---
 config.c                      | 1 +
 configs/automotive-master.cfg | 1 +
 port.c                        | 5 +++++
 port_private.h                | 1 +
 ptp4l.8                       | 5 +++++
 5 files changed, 13 insertions(+)

diff --git a/config.c b/config.c
index 9c8f703d4bbd..bd1f53f93bc3 100644
--- a/config.c
+++ b/config.c
@@ -246,6 +246,7 @@ struct config_item config_tab[] = {
        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),
+       PORT_ITEM_INT("inhibit_delay_req", 0, 0, 1),
        GLOB_ITEM_INT("initial_delay", 0, 0, INT_MAX),
        GLOB_ITEM_INT("kernel_leap", 1, 0, 1),
        PORT_ITEM_INT("logAnnounceInterval", 1, INT8_MIN, INT8_MAX),
diff --git a/configs/automotive-master.cfg b/configs/automotive-master.cfg
index e3ad5a35ebe2..2edee7666877 100644
--- a/configs/automotive-master.cfg
+++ b/configs/automotive-master.cfg
@@ -26,3 +26,4 @@ BMCA                  noop
 masterOnly             1
 inhibit_announce       1
 asCapable               true
+inhibit_delay_req       1
diff --git a/port.c b/port.c
index 47bce1642ed9..86caec0a406f 100644
--- a/port.c
+++ b/port.c
@@ -1603,6 +1603,7 @@ int port_initialize(struct port *p)
        p->logSyncInterval         = config_get_int(cfg, p->name, 
"logSyncInterval");
        p->initialLogSyncInterval  = p->logSyncInterval;
        p->operLogSyncInterval     = config_get_int(cfg, p->name, 
"operLogSyncInterval");
+       p->inhibit_delay_req       = config_get_int(cfg, p->name, 
"inhibit_delay_req");
        p->logMinPdelayReqInterval = config_get_int(cfg, p->name, 
"logMinPdelayReqInterval");
        p->logPdelayReqInterval    = p->logMinPdelayReqInterval;
        p->operLogPdelayReqInterval = config_get_int(cfg, p->name, 
"operLogPdelayReqInterval");
@@ -2543,6 +2544,10 @@ static enum fsm_event bc_event(struct port *p, int 
fd_index)
                return EV_ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES;
 
        case FD_DELAY_TIMER:
+               if (p->inhibit_delay_req) {
+                       port_clr_tmo(p->fda.fd[FD_DELAY_TIMER]);
+                       return EV_NONE;
+               }
                pr_debug("port %hu: delay timeout", portnum(p));
                port_set_delay_tmo(p);
                delay_req_prune(p);
diff --git a/port_private.h b/port_private.h
index d55562ff0a66..0565e49e1e36 100644
--- a/port_private.h
+++ b/port_private.h
@@ -100,6 +100,7 @@ struct port {
        int bmca;
        int inhibit_announce;
        int ignore_source_id;
+       int inhibit_delay_req;
        /* portDS */
        struct PortIdentity portIdentity;
        enum port_state     state; /*portState*/
diff --git a/ptp4l.8 b/ptp4l.8
index f6c13123a5ea..f13bb43e844f 100644
--- a/ptp4l.8
+++ b/ptp4l.8
@@ -742,6 +742,11 @@ to switch to change the Sync interval to the value 
specified in
 operLogSyncInterval. It will also switch Pdelay Request interval to the one
 specified in operLogPdelayReqInterval. The timer value is specified in seconds.
 The default value is 0 (disabled).
+.B inhibit_delay_req
+Don't send delay requests for P2P and E2E delay mechanisms. This will need the
+asCapable config option to be set to 'true'. This is useful when running as a
+designated master who does not need to calculate offset from slave. The default
+is 0 (disabled).
 
 .SH UNICAST DISCOVERY OPTIONS
 
-- 
2.7.3



_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to