Skip to content

Commit

Permalink
port: Add inhibit_delay_req.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
vedangpatel1 authored and richardcochran committed May 9, 2019
1 parent 3f5f565 commit 450b1ed
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions configs/automotive-master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ BMCA noop
masterOnly 1
inhibit_announce 1
asCapable true
inhibit_delay_req 1
1 change: 1 addition & 0 deletions configs/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions port.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions port_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -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*/
Expand Down
5 changes: 5 additions & 0 deletions ptp4l.8
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 450b1ed

Please sign in to comment.