Skip to content

Commit

Permalink
Add a configuration file option for the extra sync-fup check.
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Cochran <[email protected]>
  • Loading branch information
richardcochran committed Aug 29, 2013
1 parent 7b7e046 commit b7ebfab
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ use_syslog 1
verbose 0
summary_interval 0
kernel_leap 1
check_fup_sync 0
#
# Servo Options
#
Expand Down
1 change: 1 addition & 0 deletions gPTP.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ use_syslog 1
verbose 0
summary_interval 0
kernel_leap 1
check_fup_sync 0
#
# Servo options
#
Expand Down
12 changes: 12 additions & 0 deletions ptp4l.8
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions ptp4l.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down

0 comments on commit b7ebfab

Please sign in to comment.