config: port: convert 'ingressLatency' to the new scheme.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
a19318b413
commit
83e26ec68b
9
config.c
9
config.c
|
@ -99,6 +99,7 @@ struct config_item config_tab[] = {
|
||||||
GLOB_ITEM_DBL("first_step_threshold", 0.00002, 0.0, DBL_MAX),
|
GLOB_ITEM_DBL("first_step_threshold", 0.00002, 0.0, DBL_MAX),
|
||||||
PORT_ITEM_INT("follow_up_info", 0, 0, 1),
|
PORT_ITEM_INT("follow_up_info", 0, 0, 1),
|
||||||
PORT_ITEM_INT("freq_est_interval", 1, 0, INT_MAX),
|
PORT_ITEM_INT("freq_est_interval", 1, 0, INT_MAX),
|
||||||
|
PORT_ITEM_INT("ingressLatency", 0, INT_MIN, INT_MAX),
|
||||||
PORT_ITEM_INT("logAnnounceInterval", 1, INT8_MIN, INT8_MAX),
|
PORT_ITEM_INT("logAnnounceInterval", 1, INT8_MIN, INT8_MAX),
|
||||||
PORT_ITEM_INT("logMinDelayReqInterval", 0, INT8_MIN, INT8_MAX),
|
PORT_ITEM_INT("logMinDelayReqInterval", 0, INT8_MIN, INT8_MAX),
|
||||||
PORT_ITEM_INT("logMinPdelayReqInterval", 0, INT8_MIN, INT8_MAX),
|
PORT_ITEM_INT("logMinPdelayReqInterval", 0, INT8_MIN, INT8_MAX),
|
||||||
|
@ -274,13 +275,7 @@ static enum parser_result parse_pod_setting(const char *option,
|
||||||
int val;
|
int val;
|
||||||
enum parser_result r;
|
enum parser_result r;
|
||||||
|
|
||||||
if (!strcmp(option, "ingressLatency")) {
|
if (!strcmp(option, "fault_badpeernet_interval")) {
|
||||||
r = get_ranged_int(value, &val, INT_MIN, INT_MAX);
|
|
||||||
if (r != PARSED_OK)
|
|
||||||
return r;
|
|
||||||
pod->rx_timestamp_offset = val;
|
|
||||||
|
|
||||||
} else if (!strcmp(option, "fault_badpeernet_interval")) {
|
|
||||||
pod->flt_interval_pertype[FT_BAD_PEER_NETWORK].type = FTMO_LINEAR_SECONDS;
|
pod->flt_interval_pertype[FT_BAD_PEER_NETWORK].type = FTMO_LINEAR_SECONDS;
|
||||||
if (!strcasecmp("ASAP", value)) {
|
if (!strcasecmp("ASAP", value)) {
|
||||||
pod->flt_interval_pertype[FT_BAD_PEER_NETWORK].val = 0;
|
pod->flt_interval_pertype[FT_BAD_PEER_NETWORK].val = 0;
|
||||||
|
|
1
ds.h
1
ds.h
|
@ -125,7 +125,6 @@ struct portDS {
|
||||||
|
|
||||||
struct port_defaults {
|
struct port_defaults {
|
||||||
struct fault_interval flt_interval_pertype[FT_CNT];
|
struct fault_interval flt_interval_pertype[FT_CNT];
|
||||||
int rx_timestamp_offset; /*nanoseconds*/
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
4
port.c
4
port.c
|
@ -114,6 +114,7 @@ struct port {
|
||||||
int freq_est_interval;
|
int freq_est_interval;
|
||||||
int min_neighbor_prop_delay;
|
int min_neighbor_prop_delay;
|
||||||
int path_trace_enabled;
|
int path_trace_enabled;
|
||||||
|
int rx_timestamp_offset;
|
||||||
int tx_timestamp_offset;
|
int tx_timestamp_offset;
|
||||||
enum fault_type last_fault_type;
|
enum fault_type last_fault_type;
|
||||||
unsigned int versionNumber; /*UInteger4*/
|
unsigned int versionNumber; /*UInteger4*/
|
||||||
|
@ -2238,7 +2239,7 @@ enum fsm_event port_event(struct port *p, int fd_index)
|
||||||
return EV_NONE;
|
return EV_NONE;
|
||||||
}
|
}
|
||||||
if (msg_sots_valid(msg)) {
|
if (msg_sots_valid(msg)) {
|
||||||
ts_add(&msg->hwts.ts, -p->pod.rx_timestamp_offset);
|
ts_add(&msg->hwts.ts, -p->rx_timestamp_offset);
|
||||||
clock_check_ts(p->clock, msg->hwts.ts);
|
clock_check_ts(p->clock, msg->hwts.ts);
|
||||||
}
|
}
|
||||||
if (port_ignore(p, msg)) {
|
if (port_ignore(p, msg)) {
|
||||||
|
@ -2537,6 +2538,7 @@ struct port *port_open(int phc_index,
|
||||||
p->follow_up_info = config_get_int(cfg, p->name, "follow_up_info");
|
p->follow_up_info = config_get_int(cfg, p->name, "follow_up_info");
|
||||||
p->freq_est_interval = config_get_int(cfg, p->name, "freq_est_interval");
|
p->freq_est_interval = config_get_int(cfg, p->name, "freq_est_interval");
|
||||||
p->path_trace_enabled = config_get_int(cfg, p->name, "path_trace_enabled");
|
p->path_trace_enabled = config_get_int(cfg, p->name, "path_trace_enabled");
|
||||||
|
p->rx_timestamp_offset = config_get_int(cfg, p->name, "ingressLatency");
|
||||||
p->tx_timestamp_offset = config_get_int(cfg, p->name, "egressLatency");
|
p->tx_timestamp_offset = config_get_int(cfg, p->name, "egressLatency");
|
||||||
p->clock = clock;
|
p->clock = clock;
|
||||||
p->trp = transport_create(cfg, interface->transport);
|
p->trp = transport_create(cfg, interface->transport);
|
||||||
|
|
4
ptp4l.c
4
ptp4l.c
|
@ -78,10 +78,6 @@ static struct config cfg_settings = {
|
||||||
.boundary_clock_jbod = 0,
|
.boundary_clock_jbod = 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
.pod = {
|
|
||||||
.rx_timestamp_offset = 0,
|
|
||||||
},
|
|
||||||
|
|
||||||
.timestamping = TS_HARDWARE,
|
.timestamping = TS_HARDWARE,
|
||||||
.dm = DM_E2E,
|
.dm = DM_E2E,
|
||||||
.transport = TRANS_UDP_IPV4,
|
.transport = TRANS_UDP_IPV4,
|
||||||
|
|
Loading…
Reference in New Issue