diff --git a/config.c b/config.c index 7679f44..ec8c538 100644 --- a/config.c +++ b/config.c @@ -217,6 +217,12 @@ static enum parser_result parse_port_setting(const char *option, return r; iface->delay_filter_length = val; + } else if (!strcmp(option, "boundary_clock_jbod")) { + r = get_ranged_int(value, &val, 0, 1); + if (r != PARSED_OK) + return r; + iface->boundary_clock_jbod = val; + } else return NOT_PARSED; @@ -574,6 +580,12 @@ static enum parser_result parse_global_setting(const char *option, return r; cfg->dds.delay_filter_length = val; + } else if (!strcmp(option, "boundary_clock_jbod")) { + r = get_ranged_int(value, &val, 0, 1); + if (r != PARSED_OK) + return r; + cfg->dds.boundary_clock_jbod = val; + } else return NOT_PARSED; @@ -762,6 +774,7 @@ void config_init_interface(struct interface *iface, struct config *cfg) iface->delay_filter = cfg->dds.delay_filter; iface->delay_filter_length = cfg->dds.delay_filter_length; + iface->boundary_clock_jbod = cfg->dds.boundary_clock_jbod; } void config_destroy(struct config *cfg) diff --git a/config.h b/config.h index d580496..c870e42 100644 --- a/config.h +++ b/config.h @@ -41,6 +41,7 @@ struct interface { struct sk_ts_info ts_info; enum filter_type delay_filter; int delay_filter_length; + int boundary_clock_jbod; }; #define CFG_IGNORE_DM (1 << 0) diff --git a/default.cfg b/default.cfg index 0e20726..ec2ce58 100644 --- a/default.cfg +++ b/default.cfg @@ -72,6 +72,7 @@ delay_filter moving_median delay_filter_length 10 egressLatency 0 ingressLatency 0 +boundary_clock_jbod 0 # # Clock description # diff --git a/ds.h b/ds.h index 00260ed..8f44c3b 100644 --- a/ds.h +++ b/ds.h @@ -61,6 +61,7 @@ struct default_ds { struct clock_description clock_desc; enum filter_type delay_filter; int delay_filter_length; + int boundary_clock_jbod; }; struct dataset { diff --git a/gPTP.cfg b/gPTP.cfg index 689abd8..d917bd7 100644 --- a/gPTP.cfg +++ b/gPTP.cfg @@ -71,3 +71,4 @@ delay_filter moving_median delay_filter_length 10 egressLatency 0 ingressLatency 0 +boundary_clock_jbod 0 diff --git a/ptp4l.8 b/ptp4l.8 index bee42e9..0d01f29 100644 --- a/ptp4l.8 +++ b/ptp4l.8 @@ -1,4 +1,4 @@ -.TH PTP4l 8 "October 2013" "linuxptp" +.TH PTP4l 8 "December 2014" "linuxptp" .SH NAME ptp4l \- PTP Boundary/Ordinary Clock @@ -217,6 +217,16 @@ 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. +.TP +.B boundary_clock_jbod +When running as a boundary clock (that is, when more than one network +interface is configured), ptp4l performs a sanity check to make sure +that all of the ports share the same hardware clock device. This +option allows ptp4l to work as a boundary clock using "just a bunch of +devices" that are not synchronized to each other. For this mode, the +collection of clocks must be synchronized by an external program, for +example phc2sys(8) in "automatic" mode. +The default is 0 (disabled). .SH PROGRAM AND CLOCK OPTIONS diff --git a/ptp4l.c b/ptp4l.c index c18406f..1294d88 100644 --- a/ptp4l.c +++ b/ptp4l.c @@ -75,6 +75,7 @@ static struct config cfg_settings = { }, .delay_filter = FILTER_MOVING_MEDIAN, .delay_filter_length = 10, + .boundary_clock_jbod = 0, }, .pod = {