config: Add min_neighbor_prop_delay configuration variable
When peer delay is < min_neighbor_prop_delay the port is flagged as non 802.1AS capable. min_neighbor_prop_delay defaults to -20ms. Signed-off-by: Delio Brignoli <dbrignoli@audioscience.com>master
parent
bd001fdec7
commit
b2bde6f5ec
6
config.c
6
config.c
|
@ -125,6 +125,12 @@ static enum parser_result parse_pod_setting(const char *option,
|
||||||
return r;
|
return r;
|
||||||
pod->neighborPropDelayThresh = uval;
|
pod->neighborPropDelayThresh = uval;
|
||||||
|
|
||||||
|
} else if (!strcmp(option, "min_neighbor_prop_delay")) {
|
||||||
|
r = get_ranged_int(value, &val, INT_MIN, -1);
|
||||||
|
if (r != PARSED_OK)
|
||||||
|
return r;
|
||||||
|
pod->min_neighbor_prop_delay = val;
|
||||||
|
|
||||||
} else if (!strcmp(option, "fault_badpeernet_interval")) {
|
} else if (!strcmp(option, "fault_badpeernet_interval")) {
|
||||||
pod->flt_interval_pertype[FT_BAD_PEER_NETWORK].type = FTMO_LINEAR_SECONDS;
|
pod->flt_interval_pertype[FT_BAD_PEER_NETWORK].type = FTMO_LINEAR_SECONDS;
|
||||||
if (!strcasecmp("ASAP", value)) {
|
if (!strcasecmp("ASAP", value)) {
|
||||||
|
|
1
ds.h
1
ds.h
|
@ -136,6 +136,7 @@ struct port_defaults {
|
||||||
int freq_est_interval; /*log seconds*/
|
int freq_est_interval; /*log seconds*/
|
||||||
struct fault_interval flt_interval_pertype[FT_CNT];
|
struct fault_interval flt_interval_pertype[FT_CNT];
|
||||||
UInteger32 neighborPropDelayThresh; /*nanoseconds*/
|
UInteger32 neighborPropDelayThresh; /*nanoseconds*/
|
||||||
|
int min_neighbor_prop_delay; /*nanoseconds*/
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
1
gPTP.cfg
1
gPTP.cfg
|
@ -23,6 +23,7 @@ syncReceiptTimeout 3
|
||||||
delayAsymmetry 0
|
delayAsymmetry 0
|
||||||
fault_reset_interval 4
|
fault_reset_interval 4
|
||||||
neighborPropDelayThresh 800
|
neighborPropDelayThresh 800
|
||||||
|
min_neighbor_prop_delay -20000000
|
||||||
#
|
#
|
||||||
# Run time options
|
# Run time options
|
||||||
#
|
#
|
||||||
|
|
11
port.c
11
port.c
|
@ -101,6 +101,7 @@ struct port {
|
||||||
Enumeration8 delayMechanism;
|
Enumeration8 delayMechanism;
|
||||||
Integer8 logMinPdelayReqInterval;
|
Integer8 logMinPdelayReqInterval;
|
||||||
UInteger32 neighborPropDelayThresh;
|
UInteger32 neighborPropDelayThresh;
|
||||||
|
int min_neighbor_prop_delay;
|
||||||
enum fault_type last_fault_type;
|
enum fault_type last_fault_type;
|
||||||
unsigned int versionNumber; /*UInteger4*/
|
unsigned int versionNumber; /*UInteger4*/
|
||||||
/* foreignMasterDS */
|
/* foreignMasterDS */
|
||||||
|
@ -475,6 +476,15 @@ static int port_capable(struct port *p)
|
||||||
goto not_capable;
|
goto not_capable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tmv_to_nanoseconds(p->peer_delay) < p->min_neighbor_prop_delay) {
|
||||||
|
if (p->asCapable)
|
||||||
|
pr_debug("port %hu: peer_delay (%" PRId64 ") < min_neighbor_prop_delay "
|
||||||
|
"(%" PRId32 "), resetting asCapable", portnum(p),
|
||||||
|
tmv_to_nanoseconds(p->peer_delay),
|
||||||
|
p->min_neighbor_prop_delay);
|
||||||
|
goto not_capable;
|
||||||
|
}
|
||||||
|
|
||||||
if (p->pdr_missing > ALLOWED_LOST_RESPONSES) {
|
if (p->pdr_missing > ALLOWED_LOST_RESPONSES) {
|
||||||
if (p->asCapable)
|
if (p->asCapable)
|
||||||
pr_debug("port %hu: missed %d peer delay resp, "
|
pr_debug("port %hu: missed %d peer delay resp, "
|
||||||
|
@ -1378,6 +1388,7 @@ static int port_initialize(struct port *p)
|
||||||
p->logSyncInterval = p->pod.logSyncInterval;
|
p->logSyncInterval = p->pod.logSyncInterval;
|
||||||
p->logMinPdelayReqInterval = p->pod.logMinPdelayReqInterval;
|
p->logMinPdelayReqInterval = p->pod.logMinPdelayReqInterval;
|
||||||
p->neighborPropDelayThresh = p->pod.neighborPropDelayThresh;
|
p->neighborPropDelayThresh = p->pod.neighborPropDelayThresh;
|
||||||
|
p->min_neighbor_prop_delay = p->pod.min_neighbor_prop_delay;
|
||||||
|
|
||||||
for (i = 0; i < N_TIMER_FDS; i++) {
|
for (i = 0; i < N_TIMER_FDS; i++) {
|
||||||
fd[i] = -1;
|
fd[i] = -1;
|
||||||
|
|
4
ptp4l.8
4
ptp4l.8
|
@ -193,6 +193,10 @@ The default is UDPv4.
|
||||||
Upper limit for peer delay in nanoseconds. If the estimated peer delay is
|
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.
|
greater than this value the port is marked as not 802.1AS capable.
|
||||||
.TP
|
.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.
|
||||||
|
.TP
|
||||||
.B delay_filter
|
.B delay_filter
|
||||||
Select the algorithm used to filter the measured delay and peer delay. Possible
|
Select the algorithm used to filter the measured delay and peer delay. Possible
|
||||||
values are moving_average and moving_median.
|
values are moving_average and moving_median.
|
||||||
|
|
2
ptp4l.c
2
ptp4l.c
|
@ -17,6 +17,7 @@
|
||||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
#include <limits.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -90,6 +91,7 @@ static struct config cfg_settings = {
|
||||||
.freq_est_interval = 1,
|
.freq_est_interval = 1,
|
||||||
/* Default to very a large neighborPropDelay threshold */
|
/* Default to very a large neighborPropDelay threshold */
|
||||||
.neighborPropDelayThresh = 20000000,
|
.neighborPropDelayThresh = 20000000,
|
||||||
|
.min_neighbor_prop_delay = -20000000,
|
||||||
},
|
},
|
||||||
|
|
||||||
.timestamping = TS_HARDWARE,
|
.timestamping = TS_HARDWARE,
|
||||||
|
|
Loading…
Reference in New Issue