integ/base/linuxptp/debian/patches/0005-clockcheck-Increase-minimum-interval.patch
Tara Subedi 12e86c6fa5 PTP: smooth/transparent HA switchover
Currently we have following inconsistency between linuxptp and
ptp-notification app.
1) pmc_agent.cc: PMC polling interval (PMC_UPDATE_INTERVAL of 60
sec on pmc_agent_update)
2) ptp-notification app: 'overalltracker_context': {'holdover_seconds':
'15'}

In context of HA switchover, there is pmc polling in 60 sec interval
(pmc_agent_update uses PMC_UPDATE_INTERVAL i.e 60s ). This means when
primary ptp source lost, it would take 60 sec to switchover to secondary
clock.
On ptp-application app side, we have 'ptptracker_context':
{'holdover_seconds': 15} 'overalltracker_context': {'holdover_seconds':
'15'} With this, when the selected ptp source is lost more than 15 sec,
the ptp state and overall state would go holdover and then freerun.

For smooth transition, PMC_UPDATE_INTERVAL should be <<
holdover_seconds. This commit introduces configurable value for
PMC_UPDATE_INTERVAL with "phc2sys .. -p <int value [1, 3600]>",
and without configuration, the default value would be of 7 sec.

TEST PLAN:
PASS: deploy PTP with HA phy2sys parameter of "-p 60"
        or with file global parameter "pmc_update_interval_sec 60"
      stop primary ptp4l instance and check users.log to see
      the "timeout reading pmc" in 60 secs.
PASS: deploy PTP with HA Phy2sys without parameter of "-p"
      stop primary ptp4l instance and check users.log to see
      the "timeout reading pmc" in 7 secs.
      check HA switchover happens in 7 secs, and overall
      state won't change from Locked to holdover/freerun.

Story: 2011370
Task: 52061

Change-Id: I8a9123b15acbbff41954db42822b9f501cd5f2c9
Signed-off-by: Tara Nath Subedi <tara.subedi@windriver.com>
2025-04-29 15:45:08 -04:00

31 lines
1015 B
Diff

From: Miroslav Lichvar <mlichvar@redhat.com>
Date: Mon, 31 May 2021 11:07:56 +0200
Subject: [PATCH 05/63] clockcheck: Increase minimum interval.
Increase the minimum check interval to 1 second to measure the frequency
offset more accurately and with default configuration make false
positives less likely due to a heavily overloaded system.
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
[commit a082bcd700e4955ebaa00d7039bf4bce92048ac4 upstream]
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
Signed-off-by: Andre Mauricio Zelak <andre.zelak@windriver.com>
---
clockcheck.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clockcheck.c b/clockcheck.c
index d0b4714..f0141be 100644
--- a/clockcheck.c
+++ b/clockcheck.c
@@ -23,7 +23,7 @@
#include "clockcheck.h"
#include "print.h"
-#define CHECK_MIN_INTERVAL 100000000
+#define CHECK_MIN_INTERVAL 1000000000
#define CHECK_MAX_FREQ 900000000
struct clockcheck {