Implement neighborPropDelayThresh check in port_capable()

Signed-off-by: Delio Brignoli <dbrignoli@audioscience.com>
master
Delio Brignoli 2013-03-13 20:16:59 +01:00 committed by Richard Cochran
parent 3a028edbc8
commit 4626487ff3
7 changed files with 21 additions and 3 deletions

View File

@ -107,6 +107,11 @@ static enum parser_result parse_pod_setting(const char *option,
return BAD_VALUE;
pod->follow_up_info = val ? 1 : 0;
} else if (!strcmp(option, "neighborPropDelayThresh")) {
if (1 != sscanf(value, "%d", &val))
return BAD_VALUE;
pod->neighborPropDelayThresh = val;
} else if (!strcmp(option, "fault_reset_interval")) {
if (!strcasecmp("ASAP", value)) {
pod->fault_reset_interval = FRI_ASAP;

View File

@ -22,6 +22,7 @@ logMinPdelayReqInterval 0
announceReceiptTimeout 3
delayAsymmetry 0
fault_reset_interval 4
neighborPropDelayThresh 20000000
#
# Run time options
#

1
ds.h
View File

@ -125,6 +125,7 @@ struct port_defaults {
int follow_up_info;
int freq_est_interval; /*log seconds*/
int fault_reset_interval; /*log seconds*/
UInteger32 neighborPropDelayThresh; /*nanoseconds*/
};
#endif

View File

@ -21,6 +21,7 @@ logMinPdelayReqInterval 0
announceReceiptTimeout 3
delayAsymmetry 0
fault_reset_interval 4
neighborPropDelayThresh 800
#
# Run time options
#

10
port.c
View File

@ -83,6 +83,7 @@ struct port {
Integer8 logSyncInterval;
Enumeration8 delayMechanism;
Integer8 logMinPdelayReqInterval;
UInteger32 neighborPropDelayThresh;
unsigned int versionNumber; /*UInteger4*/
/* foreignMasterDS */
LIST_HEAD(fm, foreign_clock) foreign_masters;
@ -380,9 +381,11 @@ static int port_capable(struct port *p)
/* Normal 1588 ports are always capable. */
return 1;
}
/*
* TODO - Compare p->peer_delay with neighborPropDelayThresh.
*/
if (tmv_to_nanoseconds(p->peer_delay) > p->neighborPropDelayThresh) {
return 0;
}
if (p->pdr_missing > ALLOWED_LOST_RESPONSES) {
return 0;
}
@ -1071,6 +1074,7 @@ static int port_initialize(struct port *p)
p->transportSpecific = p->pod.transportSpecific;
p->logSyncInterval = p->pod.logSyncInterval;
p->logMinPdelayReqInterval = p->pod.logMinPdelayReqInterval;
p->neighborPropDelayThresh = p->pod.neighborPropDelayThresh;
tmtab_init(&p->tmtab, 1 + p->logMinDelayReqInterval);

View File

@ -195,6 +195,10 @@ The default is E2E.
.B network_transport
Select the network transport. Possible values are UDPv4, UDPv6 and L2.
The default is UDPv4.
.TP
.B neighborPropDelayThresh
Upper limit for peer delay in nanoseconds. If the estimated peer delay is
greater than this value the port is marked as not 802.1AS capable.
.SH PROGRAM AND CLOCK OPTIONS

View File

@ -80,6 +80,8 @@ static struct config cfg_settings = {
.follow_up_info = 0,
.freq_est_interval = 1,
.fault_reset_interval = 4,
/* Default to very a large neighborPropDelay threshold */
.neighborPropDelayThresh = 20000000,
},
.timestamping = TS_HARDWARE,