Re: [Linuxptp-devel] [PATCH v3 1/5] Rename NSEC2SEC as NSEC_PER_SEC and refactor to util.h

2023-11-09 Thread Rahul Rameshbabu via Linuxptp-devel
On Thu, 09 Nov, 2023 21:17:03 -0800 Richard Cochran wrote: > On Mon, Sep 25, 2023 at 10:03:09AM -0700, Rahul Rameshbabu via Linuxptp-devel > wrote: >> The name NSEC2SEC implies converting nanoseconds to seconds, but the value >> used for the macro converts seconds to nanoseconds. NSEC_PER_SEC

Re: [Linuxptp-devel] [PATCH v3 1/1] Add the PORTS_STATS_2_NP Management message.

2023-11-09 Thread Luigi 'Comio' Mantellini
I Richard, Thanks for your feedback. As already said in the previous email, for PM (Annex j, the final goal) purposes it's mandatory to capture all counters in order to be coherent. In order to avoid overloading the existing PORT_STATS_NP message I added the PORT_STATS_2_NP that carries also the

Re: [Linuxptp-devel] [RFC PATCH 0/1] Support for Port level Perforamnce Monitoring Counters

2023-11-09 Thread Luigi 'Comio' Mantellini
Sure, the Annex J is silly but the customers ask for it. :( The idea is to keep current and the last snapshot (15m, 1h, 24h) demanding the complete history to the external monitor. Using just polling on UDS is a bad idea IMHO because you need to capture at the exact same time point all counters of

Re: [Linuxptp-devel] [PATCH 5/5] phc2sys: Stop synchronization when ptp4l stops responding.

2023-11-09 Thread Richard Cochran
On Thu, Oct 26, 2023 at 02:40:11PM +0200, Miroslav Lichvar wrote: > @@ -942,8 +957,8 @@ static int auto_init_ports(struct domain *domain) > } > > err = pmc_agent_subscribe(domain->agent, 1000, > - (60 > domain->phc_interval ? > -

Re: [Linuxptp-devel] [PATCH 4/5] phc2sys: Better indicate domain with realtime clock.

2023-11-09 Thread Richard Cochran
On Thu, Oct 26, 2023 at 02:40:10PM +0200, Miroslav Lichvar wrote: > @@ -1010,7 +1010,7 @@ static int clock_handle_leap(struct domain *domain, > struct clock *clock, > struct pmc_agent *agent; > > /* The system clock's domain doesn't have a subscribed agent */ > - agent =

Re: [Linuxptp-devel] [PATCH] Problem: Under GNSS error condition/fluctuation, ts2phc updating 1sec time into PHC resulting in wrong time.

2023-11-09 Thread Richard Cochran
On Thu, Nov 09, 2023 at 06:07:57PM +, ramesh t via Linuxptp-devel wrote: > Update Code review request. Can you please provide comments? You have not identified any problem, and so I cannot comment. A proper commit message has three elements: 1. context 2. problem 3. solution That means

Re: [Linuxptp-devel] [PATCH] clock: Downgrade log message about failed uds forward.

2023-11-09 Thread Richard Cochran
On Mon, Sep 25, 2023 at 04:38:21PM +0200, Miroslav Lichvar wrote: > If multiple management clients are used in the network and ptp4l > responded at least once over UDS, it will try to forward all management > responses received from network to the last UDS client. ptp4l doesn't > track the

Re: [Linuxptp-devel] [PATCH v1] phc_ctl: Implement setting frequency from system time.

2023-11-09 Thread Richard Cochran
On Wed, Sep 13, 2023 at 05:09:04PM +, Maciek Machnikowski wrote: > Implement auto mode for frequency setting. In this mode the tool > will measure the frequency difference between PHC and CLOCK_REALTIME > and apply the correction to the PHC to match the system clock. ... > + /*

Re: [Linuxptp-devel] [PATCH] [pmc] Avoid conflicting port IDs over PMC UDS

2023-11-09 Thread Richard Cochran
On Mon, Sep 11, 2023 at 09:53:54PM +, Keller, Jacob E wrote: > > > > -Original Message- > > From: Eyal Itkin via Linuxptp-devel > > Sent: Sunday, September 10, 2023 9:23 AM > > To: linuxptp-devel@lists.sourceforge.net > > Subject: [Linuxptp-devel] [PATCH] [pmc] Avoid conflicting

Re: [Linuxptp-devel] BC not responding to each grant request TLV

2023-11-09 Thread Richard Cochran
On Wed, Sep 06, 2023 at 09:15:09AM -0400, Peter Sadrozinski via Linuxptp-devel wrote: > My question: is there any way to configure ptp4l to not concatenate TLVs in > unicast grant requests? No. > The same boundary clock works ok with a > proprietary ptp stack, which is sending unicast grant

Re: [Linuxptp-devel] [PATCH v3 1/1] Add the PORTS_STATS_2_NP Management message.

2023-11-09 Thread Richard Cochran
On Wed, Sep 06, 2023 at 09:36:38AM +0200, Luigi Mantellini wrote: > The PORTS_STATS_2_NP carries all the PORTS_STATS_NP RX/TX counters > adding room for extra counters (up to 16 counters for RX and TX). > Not all counters are filled yet. > > The PORTS_STATS_2_NP TLV has the following definition:

Re: [Linuxptp-devel] [RFC PATCH 0/1] Support for Port level Perforamnce Monitoring Counters

2023-11-09 Thread Richard Cochran
On Fri, Aug 18, 2023 at 02:34:54PM +0200, Luigi Mantellini wrote: > Dear All, > > Starting from IEEE 1588-2019 Annex J, I'm trying to introduce a Performace > monitoring Counters. > > The standard asks to keep up 98 records (96 for 15min records and 2 for 24h > records). > > I tried to follow a

Re: [Linuxptp-devel] [PATCH v3 4/5] phc_ctl: Use pr_notice instead of pr_err for displaying adjusted frequency

2023-11-09 Thread Richard Cochran
On Mon, Sep 25, 2023 at 10:03:12AM -0700, Rahul Rameshbabu via Linuxptp-devel wrote: > Adjusted frequency value displayed by do_freq is not an error, but a > notication to the user. pr_err should not be used for providing notices > with information about successful operations. > > Fixes:

Re: [Linuxptp-devel] [PATCH v3 5/5] phc_ctl: Handle errors returned by various clockadj helpers

2023-11-09 Thread Richard Cochran
On Mon, Sep 25, 2023 at 10:03:13AM -0700, Rahul Rameshbabu via Linuxptp-devel wrote: > Do not print success notices if clockadj operation fails using return > values provided by the clockadj helpers. > > Signed-off-by: Rahul Rameshbabu Applied. Thanks, Richard

Re: [Linuxptp-devel] [PATCH v3 3/5] phc_ctl: Add maximum offset capability

2023-11-09 Thread Richard Cochran
On Mon, Sep 25, 2023 at 10:03:11AM -0700, Rahul Rameshbabu via Linuxptp-devel wrote: > Advertise the maximum offset that can be fed to the PHC phase control > keyword. > > Signed-off-by: Rahul Rameshbabu Applied. Thanks, Richard ___ Linuxptp-devel

Re: [Linuxptp-devel] [PATCH v3 2/5] phc_ctl: Add phase command to support ADJ_OFFSET

2023-11-09 Thread Richard Cochran
On Mon, Sep 25, 2023 at 10:03:10AM -0700, Rahul Rameshbabu via Linuxptp-devel wrote: > Take double precision floating point representation of an offset value in > seconds. Feed this value to the PHC's phase control keyword. > > Signed-off-by: Rahul Rameshbabu Applied, with a trivial fixup.

Re: [Linuxptp-devel] [PATCH v3 1/5] Rename NSEC2SEC as NSEC_PER_SEC and refactor to util.h

2023-11-09 Thread Richard Cochran
On Mon, Sep 25, 2023 at 10:03:09AM -0700, Rahul Rameshbabu via Linuxptp-devel wrote: > The name NSEC2SEC implies converting nanoseconds to seconds, but the value > used for the macro converts seconds to nanoseconds. NSEC_PER_SEC is the > accurate name for this macro. Move macro to common location

Re: [Linuxptp-devel] [PATCH] Problem: Under GNSS error condition/fluctuation, ts2phc updating 1sec time into PHC resulting in wrong time.

2023-11-09 Thread ramesh t via Linuxptp-devel
hi, Update Code review request. Can you please provide comments? regards, Ramesh >From bbb7479baba6fe58a02aee0898777cbdb0c9005b Mon Sep 17 00:00:00 2001 From: Ramesh Gowda Date: Thu, 12 Oct 2023 15:26:27 +0530 Subject: [PATCH 1/2] Problem: Under GNSS error condition/fluctuation, ts2phc  

Re: [Linuxptp-devel] [PATCH 00/14] Initial Authentication TLV Support

2023-11-09 Thread Richard Cochran
On Thu, Nov 09, 2023 at 09:44:56AM -0500, Clay Kaiser via Linuxptp-devel wrote: > The following patch introduces initial support for immediate security > processing of > authentication tlv as defined in IEEE1588-2019 section 16.14. > > Integrity Check Values (aka Message Authentication Codes)

[Linuxptp-devel] [PATCH 01/14] tlv: add authentication tlv

2023-11-09 Thread Clay Kaiser via Linuxptp-devel
Add the authentication tlv base structure to tlv.h and basic tlv_pre_send() and tlv_post_recv() support. At this layer, there is no knowledge of security associations so only basic length checking and byte order swap is performed. Checks for the secParmIndicator are include but these fields are

[Linuxptp-devel] [PATCH 08/14] sad: introduce sad_append_auth_tlv() and sad_generate_icv()

2023-11-09 Thread Clay Kaiser via Linuxptp-devel
sad_append_auth_tlv() will append an authentication tlv as specified by the security association corresponding to the passed spp. After attached, msg_pre_send() is called to put message in network byte order and sad_generate_icv() is called to populate the icv field in the tlv. the allow_mutable

[Linuxptp-devel] [PATCH 03/14] sad: introduce nettle mac library

2023-11-09 Thread Clay Kaiser via Linuxptp-devel
Two Message Authentication Code (MAC) libraries will be added: nettle and gnutls. This patch introduces the nettle mac library along with all functions required including initialization/deinitialization of mac context using key data and generating the digest/mac/icv Signed-off-by: Clay Kaiser

[Linuxptp-devel] [PATCH 07/14] sad: introduce sad_set_last_seqid() and sad_check_seqid()

2023-11-09 Thread Clay Kaiser via Linuxptp-devel
The standard specifies that the header sequence id should be checked to confirm the message has not been replayed. It specifies a seqid check for each message that has it's own sequence id pool but this is most relevant for sync/followup messages for which slaves do not confirm seqid currently.

[Linuxptp-devel] [PATCH 11/14] sad: introduce sad_update_auth_tlv()

2023-11-09 Thread Clay Kaiser via Linuxptp-devel
Some messages do not need a new authentication tlv attached but instead only require the existing tlv to be updated because a protected field was edited. These include messages being forward via a transparent clock and management messages. Introduce sad_update_auth_tlv() to search for existing

[Linuxptp-devel] [PATCH 12/14] msg: add authentication tlv in management handling

2023-11-09 Thread Clay Kaiser via Linuxptp-devel
existing code assumed only one tlv was attached to management messages - a management tlv that started at management.suffix. If an authentication tlv is attached, these checks fail as there are now two tlvs. In addition, it is conceivable that the management tlv is attached after the

[Linuxptp-devel] [PATCH 04/14] sad: introduce gnutls mac library

2023-11-09 Thread Clay Kaiser via Linuxptp-devel
Two Message Authentication Code (MAC) libraries will be added: nettle and gnutls. This patch introduces the gnutls mac library along with all functions required including initialization/deinitialization of mac handle using key data and generating the digest/mac/icv Signed-off-by: Clay Kaiser

[Linuxptp-devel] [PATCH 00/14] Initial Authentication TLV Support

2023-11-09 Thread Clay Kaiser via Linuxptp-devel
The following patch introduces initial support for immediate security processing of authentication tlv as defined in IEEE1588-2019 section 16.14. Integrity Check Values (aka Message Authentication Codes) are calculated with nettle, or gnutls when abstracted mac support is not supported by

[Linuxptp-devel] [PATCH 14/14] nsm: add authentication tlv for nsm

2023-11-09 Thread Clay Kaiser via Linuxptp-devel
add sad_process_auth() and sad_append_auth_tlv() to the nsm_recv() and nsm_request() functions. In addition, add spp to the nsm structure and add sad_create() & sad_destroy() to functions. Signed-off-by: Clay Kaiser --- makefile | 2 +- nsm.8| 21 + nsm.c| 44

[Linuxptp-devel] [PATCH 10/14] pmc: introduce CMD support with SA_REKEY_NP

2023-11-09 Thread Clay Kaiser via Linuxptp-devel
add CMD support to the PMC to allow for new command to rekey the security associations. Signed-off-by: Clay Kaiser --- clock.c | 24 pmc_common.c | 51 +++ pmc_common.h | 2 ++ tlv.h| 1 + 4 files changed,

[Linuxptp-devel] [PATCH 13/14] pmc: add authentication tlv for pmc

2023-11-09 Thread Clay Kaiser via Linuxptp-devel
add sad_process_auth() and sad_append_auth_tlv() to the pmc_recv() and pmc_send() functions. In addition, add a config pointer & spp to the pmc structure and add sad_create() & sad_destroy() to functions. Signed-off-by: Clay Kaiser --- makefile | 14 +++--- phc2sys.8| 25

[Linuxptp-devel] [PATCH 02/14] sad: introduce security association database

2023-11-09 Thread Clay Kaiser via Linuxptp-devel
This patch adds a queue to the config structure to house the security association database and the necessary functions to copy information (spps, keys, etc) from a security associations file into the security association database. Although these functions are similar to those found in config.c,

[Linuxptp-devel] [PATCH 05/14] sad: introduce sad_process_auth() and sad_check_auth_tlv().

2023-11-09 Thread Clay Kaiser via Linuxptp-devel
sad_process_auth() contains any security processing required for a given security association including the actual check of auth tlvs. sad_check_auth_tlv() will go through all attached tlvs looking for auth tlvs and processing according to their corresponding security associations Signed-off-by:

[Linuxptp-devel] [PATCH 06/14] port: add security processing to bc_event()

2023-11-09 Thread Clay Kaiser via Linuxptp-devel
add sad_process_auth() to bc_event() to check for authentication tlvs on incoming messages. This processing happens after msg_post_recv(). However, if security is active, a duplicate message is allocated and kept in network byte order to be used for icv calculation. The standard proposes a

[Linuxptp-devel] [PATCH 09/14] man: add man updates for authentication tlv

2023-11-09 Thread Clay Kaiser via Linuxptp-devel
add necessary updates to the ptp4l man page for how to configure the spp and security association files. Signed-off-by: Clay Kaiser --- ptp4l.8 | 77 - 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/ptp4l.8 b/ptp4l.8 index