telecom: Add a configuration option to use the alternate BMCA.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2017-02-14 20:34:47 +01:00
parent 4545fd1150
commit 0c30ab463f
6 changed files with 26 additions and 1 deletions

5
bmc.h
View File

@ -29,6 +29,11 @@
#define B_BETTER -1 #define B_BETTER -1
#define B_BETTER_TOPO -2 #define B_BETTER_TOPO -2
enum {
DS_CMP_IEEE1588,
DS_CMP_G8275,
};
/** /**
* BMC state decision algorithm. * BMC state decision algorithm.
* @param c The local clock. * @param c The local clock.

View File

@ -1064,7 +1064,11 @@ struct clock *clock_create(enum clock_type type, struct config *config,
} }
c->servo_state = SERVO_UNLOCKED; c->servo_state = SERVO_UNLOCKED;
c->servo_type = servo; 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"), 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"),
config_get_int(config, NULL, "delay_filter_length")); config_get_int(config, NULL, "delay_filter_length"));

View File

@ -22,6 +22,8 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "bmc.h"
#include "config.h" #include "config.h"
#include "ether.h" #include "ether.h"
#include "hash.h" #include "hash.h"
@ -133,6 +135,12 @@ static struct config_enum clock_servo_enu[] = {
{ NULL, 0 }, { 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[] = { static struct config_enum delay_filter_enu[] = {
{ "moving_average", FILTER_MOVING_AVERAGE }, { "moving_average", FILTER_MOVING_AVERAGE },
{ "moving_median", FILTER_MOVING_MEDIAN }, { "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("clockAccuracy", 0xfe, 0, UINT8_MAX),
GLOB_ITEM_INT("clockClass", 248, 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("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_INT("delayAsymmetry", 0, INT_MIN, INT_MAX),
PORT_ITEM_ENU("delay_filter", FILTER_MOVING_MEDIAN, delay_filter_enu), PORT_ITEM_ENU("delay_filter", FILTER_MOVING_MEDIAN, delay_filter_enu),
PORT_ITEM_INT("delay_filter_length", 10, 1, INT_MAX), PORT_ITEM_INT("delay_filter_length", 10, 1, INT_MAX),

View File

@ -15,6 +15,7 @@ free_running 0
freq_est_interval 1 freq_est_interval 1
dscp_event 0 dscp_event 0
dscp_general 0 dscp_general 0
dataset_comparison ieee1588
G.8275.defaultDS.localPriority 128 G.8275.defaultDS.localPriority 128
# #
# Port Data Set # Port Data Set

View File

@ -13,6 +13,7 @@ clockAccuracy 0xFE
offsetScaledLogVariance 0xFFFF offsetScaledLogVariance 0xFFFF
free_running 0 free_running 0
freq_est_interval 1 freq_est_interval 1
dataset_comparison ieee1588
G.8275.defaultDS.localPriority 128 G.8275.defaultDS.localPriority 128
# #
# Port Data Set # Port Data Set

View File

@ -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 For example 34 (AF41 PHB) in AES67 or 46 (EF PHB) in RAVENNA. The default
is 0. is 0.
.TP .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 .B logging_level
The maximum logging level of messages which should be printed. The maximum logging level of messages which should be printed.
The default is 6 (LOG_INFO). The default is 6 (LOG_INFO).