config: Introduce options for correcting transmit and receive delays.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2014-12-06 22:14:28 +01:00
parent ef49629387
commit 53a08ec4df
6 changed files with 32 additions and 0 deletions

View File

@ -132,6 +132,18 @@ static enum parser_result parse_pod_setting(const char *option,
return r;
pod->min_neighbor_prop_delay = val;
} else if (!strcmp(option, "egressLatency")) {
r = get_ranged_int(value, &val, INT_MIN, INT_MAX);
if (r != PARSED_OK)
return r;
pod->tx_timestamp_offset = val;
} else if (!strcmp(option, "ingressLatency")) {
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;
if (!strcasecmp("ASAP", value)) {

View File

@ -70,6 +70,8 @@ delay_mechanism E2E
time_stamping hardware
delay_filter moving_median
delay_filter_length 10
egressLatency 0
ingressLatency 0
#
# Clock description
#

2
ds.h
View File

@ -137,6 +137,8 @@ struct port_defaults {
struct fault_interval flt_interval_pertype[FT_CNT];
UInteger32 neighborPropDelayThresh; /*nanoseconds*/
int min_neighbor_prop_delay; /*nanoseconds*/
int tx_timestamp_offset; /*nanoseconds*/
int rx_timestamp_offset; /*nanoseconds*/
};
#endif

View File

@ -69,3 +69,5 @@ delay_mechanism P2P
time_stamping hardware
delay_filter moving_median
delay_filter_length 10
egressLatency 0
ingressLatency 0

12
ptp4l.8
View File

@ -205,6 +205,18 @@ The default is moving_median.
.B delay_filter_length
The length of the delay filter in samples.
The default is 10.
.TP
.B egressLatency
Specifies the difference in nanoseconds between the actual transmission
time at the reference plane and the reported transmit time stamp. This
value will be added to egress time stamps obtained from the hardware.
The default is 0.
.TP
.B ingressLatency
Specifies the difference in nanoseconds between the reported receive
time stamp and the actual reception time at reference plane. This value
will be subtracted from ingress time stamps obtained from the hardware.
The default is 0.
.SH PROGRAM AND CLOCK OPTIONS

View File

@ -92,6 +92,8 @@ static struct config cfg_settings = {
/* Default to very a large neighborPropDelay threshold */
.neighborPropDelayThresh = 20000000,
.min_neighbor_prop_delay = -20000000,
.tx_timestamp_offset = 0,
.rx_timestamp_offset = 0,
},
.timestamping = TS_HARDWARE,