diff --git a/bmc.h b/bmc.h index 3f4b5fa..2901cda 100644 --- a/bmc.h +++ b/bmc.h @@ -29,6 +29,11 @@ #define B_BETTER -1 #define B_BETTER_TOPO -2 +enum { + DS_CMP_IEEE1588, + DS_CMP_G8275, +}; + /** * BMC state decision algorithm. * @param c The local clock. diff --git a/clock.c b/clock.c index 90f5b0f..08f0c42 100644 --- a/clock.c +++ b/clock.c @@ -1064,7 +1064,11 @@ struct clock *clock_create(enum clock_type type, struct config *config, } c->servo_state = SERVO_UNLOCKED; c->servo_type = servo; - c->dscmp = dscmp; + if (config_get_int(config, NULL, "dataset_comparison") == DS_CMP_G8275) { + c->dscmp = telecom_dscmp; + } else { + c->dscmp = dscmp; + } c->tsproc = tsproc_create(config_get_int(config, NULL, "tsproc_mode"), config_get_int(config, NULL, "delay_filter"), config_get_int(config, NULL, "delay_filter_length")); diff --git a/config.c b/config.c index f75092e..0b656b7 100644 --- a/config.c +++ b/config.c @@ -22,6 +22,8 @@ #include #include #include + +#include "bmc.h" #include "config.h" #include "ether.h" #include "hash.h" @@ -133,6 +135,12 @@ static struct config_enum clock_servo_enu[] = { { NULL, 0 }, }; +static struct config_enum dataset_comp_enu[] = { + { "ieee1588", DS_CMP_IEEE1588 }, + { "G.8275.x", DS_CMP_G8275 }, + { NULL, 0 }, +}; + static struct config_enum delay_filter_enu[] = { { "moving_average", FILTER_MOVING_AVERAGE }, { "moving_median", FILTER_MOVING_MEDIAN }, @@ -178,6 +186,7 @@ struct config_item config_tab[] = { GLOB_ITEM_INT("clockAccuracy", 0xfe, 0, UINT8_MAX), GLOB_ITEM_INT("clockClass", 248, 0, UINT8_MAX), GLOB_ITEM_ENU("clock_servo", CLOCK_SERVO_PI, clock_servo_enu), + GLOB_ITEM_ENU("dataset_comparison", DS_CMP_IEEE1588, dataset_comp_enu), PORT_ITEM_INT("delayAsymmetry", 0, INT_MIN, INT_MAX), PORT_ITEM_ENU("delay_filter", FILTER_MOVING_MEDIAN, delay_filter_enu), PORT_ITEM_INT("delay_filter_length", 10, 1, INT_MAX), diff --git a/default.cfg b/default.cfg index 24836dd..d7b78f2 100644 --- a/default.cfg +++ b/default.cfg @@ -15,6 +15,7 @@ free_running 0 freq_est_interval 1 dscp_event 0 dscp_general 0 +dataset_comparison ieee1588 G.8275.defaultDS.localPriority 128 # # Port Data Set diff --git a/gPTP.cfg b/gPTP.cfg index 095a444..14859e1 100644 --- a/gPTP.cfg +++ b/gPTP.cfg @@ -13,6 +13,7 @@ clockAccuracy 0xFE offsetScaledLogVariance 0xFFFF free_running 0 freq_est_interval 1 +dataset_comparison ieee1588 G.8275.defaultDS.localPriority 128 # # Port Data Set diff --git a/ptp4l.8 b/ptp4l.8 index 11e3cc0..011bd02 100644 --- a/ptp4l.8 +++ b/ptp4l.8 @@ -534,6 +534,11 @@ streaming standards out there that recommend specific values for this option. For example 34 (AF41 PHB) in AES67 or 46 (EF PHB) in RAVENNA. The default is 0. .TP +.B dataset_comparison +Specifies the method to be used when comparing data sets during the +Best Master Clock Algorithm. The possible values are "ieee1588" and +"G.8275.x". The default is "ieee1588". +.TP .B logging_level The maximum logging level of messages which should be printed. The default is 6 (LOG_INFO).