port: Add inhibit_delay_req.

Add provision to disable delay requests. Designated 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.patel@intel.com>
master
Vedang Patel 2019-03-28 20:32:31 -07:00 committed by Richard Cochran
parent 3f5f5653d7
commit 450b1ed844
6 changed files with 20 additions and 1 deletions

View File

@ -244,8 +244,9 @@ struct config_item config_tab[] = {
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),
PORT_ITEM_INT("inhibit_delay_req", 0, 0, 1),
PORT_ITEM_INT("inhibit_multicast_service", 0, 0, 1),
GLOB_ITEM_INT("kernel_leap", 1, 0, 1),
PORT_ITEM_INT("logAnnounceInterval", 1, INT8_MIN, INT8_MAX),
PORT_ITEM_INT("logMinDelayReqInterval", 0, INT8_MIN, INT8_MAX),

View File

@ -26,3 +26,4 @@ BMCA noop
masterOnly 1
inhibit_announce 1
asCapable true
inhibit_delay_req 1

View File

@ -37,6 +37,7 @@ G.8275.portDS.localPriority 128
asCapable auto
BMCA ptp
inhibit_announce 0
inhibit_pdelay_req 0
ignore_source_id 0
#
# Run time options

10
port.c
View File

@ -1056,6 +1056,10 @@ int port_set_announce_tmo(struct port *p)
int port_set_delay_tmo(struct port *p)
{
if (p->inhibit_delay_req) {
return 0;
}
if (p->delayMechanism == DM_P2P) {
return set_tmo_log(p->fda.fd[FD_DELAY_TIMER], 1,
p->logPdelayReqInterval);
@ -1657,6 +1661,12 @@ int port_initialize(struct port *p)
p->asCapable = NOT_CAPABLE;
}
p->inhibit_delay_req = config_get_int(cfg, p->name, "inhibit_delay_req");
if (p->inhibit_delay_req && p->asCapable != ALWAYS_CAPABLE) {
pr_err("inhibit_delay_req can only be set when asCapable == 'true'.");
return -1;
}
for (i = 0; i < N_TIMER_FDS; i++) {
fd[i] = -1;
}

View File

@ -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*/

View File

@ -186,6 +186,11 @@ the interval specified by this config option after the interval_update_timer
expires. It's specified as a power of two in seconds. The default value is 0 (1
second).
.TP
.B inhibit_delay_req
Don't send any delay requests. 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).
.TP
.B announceReceiptTimeout
The number of missed Announce messages before the last Announce messages
expires.