config: Add min_neighbor_prop_delay configuration variable

When peer delay is < min_neighbor_prop_delay the port is flagged
as non 802.1AS capable. min_neighbor_prop_delay defaults to -20ms.

Signed-off-by: Delio Brignoli <dbrignoli@audioscience.com>
master
Delio Brignoli 2014-02-21 18:18:08 +01:00 committed by Richard Cochran
parent bd001fdec7
commit b2bde6f5ec
6 changed files with 25 additions and 0 deletions

View File

@ -125,6 +125,12 @@ static enum parser_result parse_pod_setting(const char *option,
return r;
pod->neighborPropDelayThresh = uval;
} else if (!strcmp(option, "min_neighbor_prop_delay")) {
r = get_ranged_int(value, &val, INT_MIN, -1);
if (r != PARSED_OK)
return r;
pod->min_neighbor_prop_delay = val;
} else if (!strcmp(option, "fault_badpeernet_interval")) {
pod->flt_interval_pertype[FT_BAD_PEER_NETWORK].type = FTMO_LINEAR_SECONDS;
if (!strcasecmp("ASAP", value)) {

1
ds.h
View File

@ -136,6 +136,7 @@ struct port_defaults {
int freq_est_interval; /*log seconds*/
struct fault_interval flt_interval_pertype[FT_CNT];
UInteger32 neighborPropDelayThresh; /*nanoseconds*/
int min_neighbor_prop_delay; /*nanoseconds*/
};
#endif

View File

@ -23,6 +23,7 @@ syncReceiptTimeout 3
delayAsymmetry 0
fault_reset_interval 4
neighborPropDelayThresh 800
min_neighbor_prop_delay -20000000
#
# Run time options
#

11
port.c
View File

@ -101,6 +101,7 @@ struct port {
Enumeration8 delayMechanism;
Integer8 logMinPdelayReqInterval;
UInteger32 neighborPropDelayThresh;
int min_neighbor_prop_delay;
enum fault_type last_fault_type;
unsigned int versionNumber; /*UInteger4*/
/* foreignMasterDS */
@ -475,6 +476,15 @@ static int port_capable(struct port *p)
goto not_capable;
}
if (tmv_to_nanoseconds(p->peer_delay) < p->min_neighbor_prop_delay) {
if (p->asCapable)
pr_debug("port %hu: peer_delay (%" PRId64 ") < min_neighbor_prop_delay "
"(%" PRId32 "), resetting asCapable", portnum(p),
tmv_to_nanoseconds(p->peer_delay),
p->min_neighbor_prop_delay);
goto not_capable;
}
if (p->pdr_missing > ALLOWED_LOST_RESPONSES) {
if (p->asCapable)
pr_debug("port %hu: missed %d peer delay resp, "
@ -1378,6 +1388,7 @@ static int port_initialize(struct port *p)
p->logSyncInterval = p->pod.logSyncInterval;
p->logMinPdelayReqInterval = p->pod.logMinPdelayReqInterval;
p->neighborPropDelayThresh = p->pod.neighborPropDelayThresh;
p->min_neighbor_prop_delay = p->pod.min_neighbor_prop_delay;
for (i = 0; i < N_TIMER_FDS; i++) {
fd[i] = -1;

View File

@ -193,6 +193,10 @@ The default is UDPv4.
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.
.TP
.B min_neighbor_prop_delay
Lower limit for peer delay in nanoseconds. If the estimated peer delay is
smaller than this value the port is marked as not 802.1AS capable.
.TP
.B delay_filter
Select the algorithm used to filter the measured delay and peer delay. Possible
values are moving_average and moving_median.

View File

@ -17,6 +17,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <limits.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@ -90,6 +91,7 @@ static struct config cfg_settings = {
.freq_est_interval = 1,
/* Default to very a large neighborPropDelay threshold */
.neighborPropDelayThresh = 20000000,
.min_neighbor_prop_delay = -20000000,
},
.timestamping = TS_HARDWARE,