Add a configuration file option for the extra sync-fup check.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2013-08-29 11:01:27 +02:00
parent 7b7e046e91
commit b7ebfab0cc
6 changed files with 22 additions and 0 deletions

View File

@ -301,6 +301,12 @@ static enum parser_result parse_global_setting(const char *option,
return r;
*cfg->tx_timestamp_timeout = val;
} else if (!strcmp(option, "check_fup_sync")) {
r = get_ranged_int(value, &val, 0, 1);
if (r != PARSED_OK)
return r;
*cfg->check_fup_sync = val;
} else if (!strcmp(option, "pi_proportional_const")) {
r = get_ranged_double(value, &df, 0.0, DBL_MAX);
if (r != PARSED_OK)

View File

@ -70,6 +70,7 @@ struct config {
struct port_defaults pod;
int *assume_two_step;
int *tx_timestamp_timeout;
int *check_fup_sync;
enum servo_type clock_servo;

View File

@ -36,6 +36,7 @@ use_syslog 1
verbose 0
summary_interval 0
kernel_leap 1
check_fup_sync 0
#
# Servo Options
#

View File

@ -35,6 +35,7 @@ use_syslog 1
verbose 0
summary_interval 0
kernel_leap 1
check_fup_sync 0
#
# Servo options
#

12
ptp4l.8
View File

@ -255,6 +255,18 @@ The number of milliseconds to poll waiting for the tx time stamp from the kernel
when a message has recently been sent.
The default is 1.
.TP
.B check_fup_sync
Because of packet reordering that can occur in the network, in the
hardware, or in the networking stack, a follow up message can appear
to arrive in the application before the matching sync message. As this
is a normal occurrence, and the sequenceID message field ensures
proper matching, the ptp4l program accepts out of order packets. This
option adds an additional check using the software time stamps from
the networking stack to verify that the sync message did arrive
first. This option is only useful if you do not trust the sequence IDs
generated by the master.
The default is 0 (disabled).
.TP
.B clock_servo
The servo which is used to synchronize the local clock. Currently only one
servo is implemented, a PI controller.

View File

@ -92,6 +92,7 @@ static struct config cfg_settings = {
.assume_two_step = &assume_two_step,
.tx_timestamp_timeout = &sk_tx_timeout,
.check_fup_sync = &sk_check_fupsync,
.clock_servo = CLOCK_SERVO_PI,