Implement neighborPropDelayThresh check in port_capable()
Signed-off-by: Delio Brignoli <dbrignoli@audioscience.com>master
parent
3a028edbc8
commit
4626487ff3
5
config.c
5
config.c
|
@ -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;
|
||||
|
|
|
@ -22,6 +22,7 @@ logMinPdelayReqInterval 0
|
|||
announceReceiptTimeout 3
|
||||
delayAsymmetry 0
|
||||
fault_reset_interval 4
|
||||
neighborPropDelayThresh 20000000
|
||||
#
|
||||
# Run time options
|
||||
#
|
||||
|
|
1
ds.h
1
ds.h
|
@ -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
|
||||
|
|
1
gPTP.cfg
1
gPTP.cfg
|
@ -21,6 +21,7 @@ logMinPdelayReqInterval 0
|
|||
announceReceiptTimeout 3
|
||||
delayAsymmetry 0
|
||||
fault_reset_interval 4
|
||||
neighborPropDelayThresh 800
|
||||
#
|
||||
# Run time options
|
||||
#
|
||||
|
|
10
port.c
10
port.c
|
@ -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);
|
||||
|
||||
|
|
4
ptp4l.8
4
ptp4l.8
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue