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

Signed-off-by: Vedang Patel <vedang.pa...@intel.com>
---
 config.c                      | 1 +
 configs/automotive-master.cfg | 1 +
 configs/default.cfg           | 1 +
 port.c                        | 5 +++++
 port_private.h                | 1 +
 ptp4l.8                       | 6 ++++++
 6 files changed, 15 insertions(+)

diff --git a/config.c b/config.c
index e006597adaed..1373a79c0c7d 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_pdelay_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..d51893543f25 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_pdelay_req       1
diff --git a/configs/default.cfg b/configs/default.cfg
index f922fd011804..bf83add85383 100644
--- a/configs/default.cfg
+++ b/configs/default.cfg
@@ -37,6 +37,7 @@ G.8275.portDS.localPriority   128
 asCapable               auto
 BMCA                    ptp
 inhibit_announce        0
+inhibit_pdelay_req      0
 ignore_source_id        0
 ignore_interval_update_req 0
 #
diff --git a/port.c b/port.c
index f5d5b0d10e3c..bc85bfa23cb0 100644
--- a/port.c
+++ b/port.c
@@ -1221,6 +1221,10 @@ static int port_pdelay_request(struct port *p)
        struct ptp_message *msg;
        int err;
 
+       if (p->inhibit_pdelay_req) {
+               return 0;
+       }
+
        /* If multiple pdelay resp were not detected the counter can be reset */
        if (!p->multiple_pdr_detected) {
                p->multiple_seq_pdr_count = 0;
@@ -1603,6 +1607,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_pdelay_req       = config_get_int(cfg, p->name, 
"inhibit_pdelay_req");
        p->logMinPdelayReqInterval = config_get_int(cfg, p->name, 
"logMinPdelayReqInterval");
        p->logPdelayReqInterval    = p->logMinPdelayReqInterval;
        p->operLogPdelayReqInterval = config_get_int(cfg, p->name, 
"operLogPdelayReqInterval");
diff --git a/port_private.h b/port_private.h
index a1951e0361bd..0e1440c7df20 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_pdelay_req;
        /* portDS */
        struct PortIdentity portIdentity;
        enum port_state     state; /*portState*/
diff --git a/ptp4l.8 b/ptp4l.8
index 6cf9c71a255e..dd23e3f73538 100644
--- a/ptp4l.8
+++ b/ptp4l.8
@@ -749,6 +749,12 @@ sync message intervals and pdelay request intervals can be 
indicated by
 operLogSyncInterval and operLogPdelayReqInterval respectively. This mechanism
 is currently only supported when BMCA == 'noop'. The default
 value of offset_threshold is 0 (disabled).
+.TP
+.B inhibit_pdelay_req
+Don't send delay requests for P2P 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
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to