integ/base/linuxptp/debian/patches/0055-Ignore-interface-in-conf-file-when-HA-is-disabled.patch
Cole Walker aca42c6d4c Implement logic to skip updates with offset spike in ts2phc.
This change allows ts2phc to be configured to ignore timing updates that
have a large offset spike in order to mitigate the resulting timing
skew.

In some circumstances on realtime systems with high CPU load, the
timestamp consumed by ts2phc can be delayed in reaching ts2phc and
results in the offset calculation attempting to speed the clock up by a
large margin.

This change causes ts2phc to ignore updates that would greatly skew the
clock when ts2phc is already in a synchronized state.

The global configuration option "max_phc_update_skip_cnt" is provided to
allow users to specify how many consecutive offset spike incidents will
be ignored before adjusting the clock. The default value is 120. The
behaviour can be disabled by setting max_phc_update_skip_cnt to 0.

This code is ported from a proposed upstream patch found here:
https://sourceforge.net/p/linuxptp/mailman/message/44114092/

Test-plan:
Pass: Verify linuxptp package build
Pass: Deploy ts2phc binary and verify system time sync
Pass: Manually trigger offset spike and verify that ts2phc maintains
stable time sync

Closes-bug: https://bugs.launchpad.net/starlingx/+bug/2059955

Change-Id: I13cd5c3440682ec9256e11449fe62d5fe28f66fa
Signed-off-by: Cole Walker <cole.walker@windriver.com>
2024-04-01 14:53:06 -04:00

53 lines
1.8 KiB
Diff

From a61444e795236013bfca2e45100a45e14f0474c9 Mon Sep 17 00:00:00 2001
From: Andre Mauricio Zelak <andre.zelak@windriver.com>
Date: Thu, 4 Jan 2024 13:27:09 -0300
Subject: [PATCH 55/58] Ignore interface in conf file when HA is disabled
Fixed the behavior when HA is disabled, one interface has been configured and
'-a' autoconfiguration option is enabled. The behavior before HA feature was
to ignore the givven interface. To keep retrocompatibility with earlier
configurations, interfaces in the configuration file are ignored
if HA is disabled.
Test Plan: non HA
PASS: Verify behavior when HA is disabled and interface has been configured
PASS: Verify behavior when HA is ommited and interface has been configured
PASS: Verify behavior when HA is disabled and no interface has been configured
Test Plan: HA
PASS: Verify phc2sys exit with error when HA is enabled and one interface
has been configured.
Closes-bug: 2048085
Signed-off-by: Andre Mauricio Zelak <andre.zelak@windriver.com>
---
phc2sys.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/phc2sys.c b/phc2sys.c
index 4120568..1f6b6c2 100644
--- a/phc2sys.c
+++ b/phc2sys.c
@@ -2236,7 +2236,8 @@ int main(int argc, char *argv[])
return c;
}
- if (src_cnt == 0) {
+ ha_enabled = config_get_int(cfg, NULL, "ha_enabled");
+ if (ha_enabled && src_cnt == 0) {
/* get the source interface list from configuration file */
src_cnt = config_get_interfaces(cfg, src_names, MAX_SRC_CLOCKS);
if (src_cnt == (unsigned int)-1) {
@@ -2297,7 +2298,6 @@ int main(int argc, char *argv[])
goto end;
}
- ha_enabled = config_get_int(cfg, NULL, "ha_enabled");
if (!ha_enabled && src_cnt > 1) {
fprintf(stderr, "too many source clocks\n");
fprintf(stderr, "Use 'ha_enabled 1' to accept more than one source clock\n");
--
2.30.2