
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>
34 lines
1.2 KiB
Diff
34 lines
1.2 KiB
Diff
From: Andre Mauricio Zelak <andre.zelak@windriver.com>
|
|
Date: Mon, 12 Jun 2023 17:51:10 -0300
|
|
Subject: [PATCH 32/63] phc2sys: Fix regression in the automatic mode.
|
|
|
|
Commit ac7d69bbc476 ("pmc_agent: Convert the method that queries the
|
|
port properties.") had the well meant intention of the cleaning up the
|
|
error code semantics of the port properties query function. However,
|
|
that commit mixed up the normal, external semantics of zero meaning
|
|
success with the internal semantics where zero is an error. Correct
|
|
the issue by replacing the hard coded number with the proper macro.
|
|
|
|
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
|
|
Fixes: ac7d69bbc476 ("pmc_agent: Convert the method that queries the port properties.")
|
|
|
|
[commit 0fb1be2f5c4d6905f33a2b1c31e7496d52296748 upstream]
|
|
Signed-off-by: Andre Mauricio Zelak <andre.zelak@windriver.com>
|
|
---
|
|
pmc_agent.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/pmc_agent.c b/pmc_agent.c
|
|
index 6e6627d..623f300 100644
|
|
--- a/pmc_agent.c
|
|
+++ b/pmc_agent.c
|
|
@@ -338,7 +338,7 @@ int pmc_agent_query_port_properties(struct pmc_agent *node, int timeout,
|
|
iface[len] = '\0';
|
|
|
|
msg_put(msg);
|
|
- res = 0;
|
|
+ res = RUN_PMC_OKAY;
|
|
break;
|
|
}
|
|
out:
|