From 3ff0e4a589672e4eb58bf02a28f66347f72eb79f Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Sat, 15 Aug 2015 13:19:05 +0200 Subject: [PATCH] config: port: convert 'min_neighbor_prop_delay' to the new scheme. Signed-off-by: Richard Cochran --- config.c | 9 ++------- ds.h | 1 - port.c | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/config.c b/config.c index d8ce1e2..a4282f8 100644 --- a/config.c +++ b/config.c @@ -104,6 +104,7 @@ struct config_item config_tab[] = { PORT_ITEM_INT("logSyncInterval", 0, INT8_MIN, INT8_MAX), GLOB_ITEM_INT("logging_level", LOG_INFO, PRINT_LEVEL_MIN, PRINT_LEVEL_MAX), GLOB_ITEM_INT("max_frequency", 900000000, 0, INT_MAX), + PORT_ITEM_INT("min_neighbor_prop_delay", -20000000, INT_MIN, -1), PORT_ITEM_INT("neighborPropDelayThresh", 20000000, 0, INT_MAX), GLOB_ITEM_INT("ntpshm_segment", 0, INT_MIN, INT_MAX), PORT_ITEM_INT("path_trace_enabled", 0, 0, 1), @@ -272,13 +273,7 @@ static enum parser_result parse_pod_setting(const char *option, int val; enum parser_result r; - 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, "egressLatency")) { + if (!strcmp(option, "egressLatency")) { r = get_ranged_int(value, &val, INT_MIN, INT_MAX); if (r != PARSED_OK) return r; diff --git a/ds.h b/ds.h index fb91d00..23e5033 100644 --- a/ds.h +++ b/ds.h @@ -125,7 +125,6 @@ struct portDS { struct port_defaults { struct fault_interval flt_interval_pertype[FT_CNT]; - int min_neighbor_prop_delay; /*nanoseconds*/ int tx_timestamp_offset; /*nanoseconds*/ int rx_timestamp_offset; /*nanoseconds*/ }; diff --git a/port.c b/port.c index 1e01a78..d01ff73 100644 --- a/port.c +++ b/port.c @@ -1458,7 +1458,7 @@ static int port_initialize(struct port *p) p->logSyncInterval = config_get_int(cfg, p->name, "logSyncInterval"); p->logMinPdelayReqInterval = config_get_int(cfg, p->name, "logMinPdelayReqInterval"); p->neighborPropDelayThresh = config_get_int(cfg, p->name, "neighborPropDelayThresh"); - p->min_neighbor_prop_delay = p->pod.min_neighbor_prop_delay; + p->min_neighbor_prop_delay = config_get_int(cfg, p->name, "min_neighbor_prop_delay"); for (i = 0; i < N_TIMER_FDS; i++) { fd[i] = -1;