[Linuxptp-devel] [PATCH 3/4] pmc_agent: Generalize the method that queries the local clock identity.

2020-11-28 Thread Richard Cochran
When started in automatic mode, the phc2sys program first queries the local clock identification and then the number of ports immediately afterwords. However, both of those values come from the default data set. Make code both simpler and more efficient by caching the entire data set inside of

[Linuxptp-devel] [PATCH 2/4] pmc_agent: Convert the method that queries the port properties.

2020-11-28 Thread Richard Cochran
Prefix the function with the module name and correct the return code semantics. The active word in the function's name is "query" rather that "get" in order to distinguish methods that send and receive over the network from those that merely return a cached value. Signed-off-by: Richard Cochran

[Linuxptp-devel] [PATCH 4/4] pmc_agent: Simplify the method that gets of the number of local ports.

2020-11-28 Thread Richard Cochran
The number of ports is already available in the cached default data set. Use it directly. Signed-off-by: Richard Cochran --- phc2sys.c | 2 +- pmc_agent.c | 24 pmc_agent.h | 11 ++- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/phc2sys.c

[Linuxptp-devel] [PATCH 1/4] pmc_agent: Convert the method that queries TAI-UTC offset into the canonical form.

2020-11-28 Thread Richard Cochran
This patch renames the function to have the module prefix and corrects the return code semantics. The active word in the function's name is "query" rather that "get" in order to distinguish methods that send and receive over the network from those that merely return a cached value.

[Linuxptp-devel] [PATCH 0/4] PMC Agent - Part III - Query Functions

2020-11-28 Thread Richard Cochran
This series introduces "query" functions, not to be confused with "get" methods. The former transmits a request to the ptp4l service, while the latter simply returns the cached values. - Patches 1 and 2 are straightforward conversions of the existing API. - Patches 3-4 combine two queries into

Re: [Linuxptp-devel] [PATCH 7/7] pmc_agent: Rename the update method and attempt to document it.

2020-11-28 Thread Richard Cochran
On Sat, Nov 28, 2020 at 12:24:44PM +0200, Vladimir Oltean wrote: > So we have a pretty large reconvergence time every time there is a leap > second. No, the upstream server must set the leap second status flag at least twelve hours before the end of the UTC day. The phc2sys program's

Re: [Linuxptp-devel] [PATCH 7/7] pmc_agent: Rename the update method and attempt to document it.

2020-11-28 Thread Vladimir Oltean
On Fri, Nov 27, 2020 at 04:15:29PM -0800, Richard Cochran wrote: > The UTC offset is not subscribed. It is polled with a request/reply > once a minute. (Only the port state has a push notification.) So we have a pretty large reconvergence time every time there is a leap second.

Re: [Linuxptp-devel] [PATCH v2 7/7] pmc_agent: Rename the update method and attempt to document it.

2020-11-28 Thread Vladimir Oltean
On Fri, Nov 27, 2020 at 06:30:11PM -0800, Richard Cochran wrote: > This patch renames the function to have the module prefix and tries to > put into words what it does. > > Signed-off-by: Richard Cochran > --- Reviewed-by: Vladimir Oltean ___

Re: [Linuxptp-devel] [PATCH v2 5/7] pmc_agent: Remove bogus comparison between last update and now.

2020-11-28 Thread Vladimir Oltean
On Fri, Nov 27, 2020 at 06:30:09PM -0800, Richard Cochran wrote: > The monotonic clock can never go backwards. If you take T1 and later T2 > from that clock, then (T2 > T1) is always true. > > This patch removes the useless test. > > [ This test evolved over the years. Originally the time stamp

Re: [Linuxptp-devel] [PATCH v2 6/7] pmc_agent: Perform time comparison using positive logic.

2020-11-28 Thread Vladimir Oltean
On Fri, Nov 27, 2020 at 06:30:10PM -0800, Richard Cochran wrote: > In the update_pmc_node() method, reduce the expression > !(x < y) to (x >= y). > > While we're at it, clean the coding style as well. > > Signed-off-by: Richard Cochran > --- Reviewed-by: Vladimir Oltean

Re: [Linuxptp-devel] [PATCH v2 4/7] pmc_agent: Simplify logic in update method.

2020-11-28 Thread Vladimir Oltean
On Fri, Nov 27, 2020 at 06:30:08PM -0800, Richard Cochran wrote: > If the pmc pointer is not set, then there is no need to read the time only > to later discard the result. This patch simplifies the flow by returning > early if there is no work to be done. > > Signed-off-by: Richard Cochran >

Re: [Linuxptp-devel] [PATCH v2 3/7] pmc_agent: Simplify the update method.

2020-11-28 Thread Vladimir Oltean
On Fri, Nov 27, 2020 at 06:30:07PM -0800, Richard Cochran wrote: > The main method that causes the PMC agent to update its status takes a flag > that results in different behavior when push notifications are active. > This patch simplifies the interface by letting the agent remember whether > or