From c7fb52572179b4009cd7dcb7e0a841af3808a7d2 Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Tue, 14 Feb 2017 19:55:51 +0100 Subject: [PATCH] telecom: Add a configuration option for G.8275.defaultDS.localPriority. Signed-off-by: Richard Cochran --- clock.c | 3 ++- config.c | 1 + default.cfg | 1 + gPTP.cfg | 1 + ptp4l.8 | 14 ++++++++++++++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/clock.c b/clock.c index 19ce805..90f5b0f 100644 --- a/clock.c +++ b/clock.c @@ -931,7 +931,8 @@ struct clock *clock_create(enum clock_type type, struct config *config, c->dds.flags & DDS_SLAVE_ONLY) { c->dds.clockQuality.clockClass = 255; } - c->default_dataset.localPriority = 128; + c->default_dataset.localPriority = + config_get_int(config, NULL, "G.8275.defaultDS.localPriority"); /* Harmonize the twoStepFlag with the time_stamping option. */ if (config_harmonize_onestep(config)) { diff --git a/config.c b/config.c index 320cc1b..9c26ccd 100644 --- a/config.c +++ b/config.c @@ -192,6 +192,7 @@ struct config_item config_tab[] = { PORT_ITEM_INT("follow_up_info", 0, 0, 1), GLOB_ITEM_INT("free_running", 0, 0, 1), PORT_ITEM_INT("freq_est_interval", 1, 0, INT_MAX), + GLOB_ITEM_INT("G.8275.defaultDS.localPriority", 128, 1, UINT8_MAX), GLOB_ITEM_INT("gmCapable", 1, 0, 1), PORT_ITEM_INT("hybrid_e2e", 0, 0, 1), PORT_ITEM_INT("ignore_transport_specific", 0, 0, 1), diff --git a/default.cfg b/default.cfg index e76aeae..9736568 100644 --- a/default.cfg +++ b/default.cfg @@ -15,6 +15,7 @@ free_running 0 freq_est_interval 1 dscp_event 0 dscp_general 0 +G.8275.defaultDS.localPriority 128 # # Port Data Set # diff --git a/gPTP.cfg b/gPTP.cfg index 1e7a33e..02fd395 100644 --- a/gPTP.cfg +++ b/gPTP.cfg @@ -13,6 +13,7 @@ clockAccuracy 0xFE offsetScaledLogVariance 0xFFFF free_running 0 freq_est_interval 1 +G.8275.defaultDS.localPriority 128 # # Port Data Set # diff --git a/ptp4l.8 b/ptp4l.8 index 950e07c..10f55f2 100644 --- a/ptp4l.8 +++ b/ptp4l.8 @@ -341,6 +341,20 @@ The offsetScaledLogVariance attribute of the local clock. It characterizes the stability of the clock. The default is 0xFFFF. .TP +.B G.8275.defaultDS.localPriority +The Telecom Profiles (ITU-T G.8275.1 and G.8275.2) specify an +alternate Best Master Clock Algorithm (BMCA) with a unique data set +comparison algorithm. The value of this option is associated with the +local clock 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 +G.8275.defaultDS.localPriority and G.8275.portDS.localPriority. +Careful network engineering is needed when using non-default values. +.TP .B domainNumber The domain attribute of the local clock. The default is 0.