Signed-off-by: Richard Cochran <richardcoch...@gmail.com> --- config.c | 1 + default.cfg | 1 + gPTP.cfg | 1 + port.c | 4 +++- ptp4l.8 | 15 +++++++++++++++ 5 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/config.c b/config.c index 3d1a752..a87598f 100644 --- a/config.c +++ b/config.c @@ -217,6 +217,7 @@ struct config_item config_tab[] = { GLOB_ITEM_DBL("pi_proportional_exponent", -0.3, -DBL_MAX, DBL_MAX), GLOB_ITEM_DBL("pi_proportional_norm_max", 0.7, DBL_MIN, 1.0), GLOB_ITEM_DBL("pi_proportional_scale", 0.0, 0.0, DBL_MAX), + PORT_ITEM_INT("portDS.localPriority", 128, 1, UINT8_MAX), GLOB_ITEM_INT("priority1", 128, 0, UINT8_MAX), GLOB_ITEM_INT("priority2", 128, 0, UINT8_MAX), GLOB_ITEM_STR("productDescription", ";;"), diff --git a/default.cfg b/default.cfg index 1b5f493..726282c 100644 --- a/default.cfg +++ b/default.cfg @@ -28,6 +28,7 @@ syncReceiptTimeout 0 delayAsymmetry 0 fault_reset_interval 4 neighborPropDelayThresh 20000000 +portDS.localPriority 128 # # Run time options # diff --git a/gPTP.cfg b/gPTP.cfg index d9a0140..eced121 100644 --- a/gPTP.cfg +++ b/gPTP.cfg @@ -26,6 +26,7 @@ delayAsymmetry 0 fault_reset_interval 4 neighborPropDelayThresh 800 min_neighbor_prop_delay -20000000 +portDS.localPriority 128 # # Run time options # diff --git a/port.c b/port.c index 73495d0..a2e6fdf 100644 --- a/port.c +++ b/port.c @@ -111,6 +111,7 @@ struct port { int announce_span; UInteger8 syncReceiptTimeout; UInteger8 transportSpecific; + UInteger8 localPriority; Integer8 logSyncInterval; Enumeration8 delayMechanism; Integer8 logMinPdelayReqInterval; @@ -159,7 +160,7 @@ static void announce_to_dataset(struct ptp_message *m, struct port *p, out->identity = a->grandmasterIdentity; out->quality = a->grandmasterClockQuality; out->priority2 = a->grandmasterPriority2; - out->localPriority = 128; + out->localPriority = p->localPriority; out->stepsRemoved = a->stepsRemoved; out->sender = m->header.sourcePortIdentity; out->receiver = p->portIdentity; @@ -1483,6 +1484,7 @@ static int port_initialize(struct port *p) p->syncReceiptTimeout = config_get_int(cfg, p->name, "syncReceiptTimeout"); p->transportSpecific = config_get_int(cfg, p->name, "transportSpecific"); p->transportSpecific <<= 4; + p->localPriority = config_get_int(cfg, p->name, "portDS.localPriority"); p->logSyncInterval = config_get_int(cfg, p->name, "logSyncInterval"); p->logMinPdelayReqInterval = config_get_int(cfg, p->name, "logMinPdelayReqInterval"); p->neighborPropDelayThresh = config_get_int(cfg, p->name, "neighborPropDelayThresh"); diff --git a/ptp4l.8 b/ptp4l.8 index 1e43458..0aeabcc 100644 --- a/ptp4l.8 +++ b/ptp4l.8 @@ -227,6 +227,21 @@ The default is UDPv4. Upper limit for peer delay in nanoseconds. If the estimated peer delay is greater than this value the port is marked as not 802.1AS capable. .TP +.B portDS.localPriority +The Telecom Profile (ITU-T G.8275.1) specifies an alternate Best +Master Clock Algorithm (BMCA) with a unique data set comparison +algorithm. The value of this option is associated with Announce +messages arriving on a particular port and is used as a tie breaker +whenever clockClass, clockAccuracy, offsetScaledLogVariance, and +priority2 are equal. This option is only used when +"dataset_comparison" is set to "telecom". +The default value is 128. + +Warning: the BMCA is guaranteed to produce a spanning tree (that is, a +timing network without loops) only when using the default values of +defaultDS.localPriority and portDS.localPriority. Careful network +engineering is needed when using non-default values. +.TP .B min_neighbor_prop_delay Lower limit for peer delay in nanoseconds. If the estimated peer delay is smaller than this value the port is marked as not 802.1AS capable. -- 2.11.0 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel