Re: [Linuxptp-devel] [PATCH] phc2sys: Add support for free-running mode

2022-06-20 Thread maciek
> -Original Message- > From: Miroslav Lichvar > Sent: Monday, June 20, 2022 5:14 PM > To: Richard Cochran > Cc: Maciek Machnikowski ; linuxptp- > de...@lists.sourceforge.net > Subject: Re: [Linuxptp-devel] [PATCH] phc2sys: Add support for free-running > mode >

[Linuxptp-devel] [PATCH] phc2sys: Add support for free-running mode

2022-06-20 Thread Maciek Machnikowski
Add support for the free-running mode that will not adjust the sink clock when enabled. Signed-off-by: Maciek Machnikowski --- phc2sys.8 | 4 phc2sys.c | 14 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/phc2sys.8 b/phc2sys.8 index 99fc937..42f2bdb 100644

[Linuxptp-devel] [PATCH v2] phc2sys: Add support for free-running mode

2022-06-21 Thread Maciek Machnikowski
Add support for the free-running mode that will not adjust the sink clock when enabled. V2: changed implementation to instantiate NTPSHM servo that serves as the nochange servo Signed-off-by: Maciek Machnikowski --- phc2sys.8 | 4 phc2sys.c | 9 - 2 files changed, 12

Re: [Linuxptp-devel] [PATCH v2] phc2sys: Add support for free-running mode

2022-06-21 Thread Maciek Machnikowski
> -Original Message- > From: Miroslav Lichvar > Sent: Tuesday, June 21, 2022 11:19 AM > To: Maciek Machnikowski > Cc: linuxptp-devel@lists.sourceforge.net > Subject: Re: [Linuxptp-devel] [PATCH v2] phc2sys: Add support for free-running > mode > > On Tue, Jun 2

[Linuxptp-devel] [PATCH v3] phc2sys: Add support for free-running mode

2022-06-21 Thread Maciek Machnikowski
Add support for the free-running mode that will not adjust the sink clock when enabled. V2: changed implementation to instantiate NTPSHM servo that serves as the nochange servo V3: revert to original implementation and remove unused global Signed-off-by: Maciek Machnikowski --- phc2sys.8

[Linuxptp-devel] [PATCH] phc2sys: Allow multiple sink clocks

2022-06-21 Thread Maciek Machnikowski
Currently, if the -c parameter is used multiple times only the last clock will be synchronized and no error will be returned. This patch implements proper support for multiple -c parameter and will synchronize all clocks to the selected source. Signed-off-by: Maciek Machnikowski --- phc2sys.c

Re: [Linuxptp-devel] [PATCH] phc2sys: Allow multiple sink clocks

2022-06-23 Thread Maciek Machnikowski
> -Original Message- > From: Miroslav Lichvar > Subject: Re: [Linuxptp-devel] [PATCH] phc2sys: Allow multiple sink clocks > > On Tue, Jun 21, 2022 at 01:38:51PM +0200, Maciek Machnikowski wrote: > > Currently, if the -c parameter is used multiple times only the l

Re: [Linuxptp-devel] [PATCH] phc2sys: Allow multiple sink clocks

2022-06-23 Thread Maciek Machnikowski
> -Original Message- > From: Miroslav Lichvar > Subject: Re: [Linuxptp-devel] [PATCH] phc2sys: Allow multiple sink clocks > > On Thu, Jun 23, 2022 at 04:58:33PM +0200, Maciek Machnikowski wrote: > > > > @@ -1266,6 +1277,10 @@ int main(int argc, char *argv[])

[Linuxptp-devel] [PATCH v2] phc2sys: Allow multiple sink clocks

2022-06-23 Thread Maciek Machnikowski
Signed-off-by: Maciek Machnikowski --- phc2sys.8 | 2 +- phc2sys.c | 42 ++ 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/phc2sys.8 b/phc2sys.8 index 99fc937..9277e01 100644 --- a/phc2sys.8 +++ b/phc2sys.8 @@ -120,7 +120,7 @@ Specify the time

[Linuxptp-devel] [PATCH v4] phc2sys: Add support for free-running mode

2022-07-25 Thread Maciek Machnikowski
() Signed-off-by: Maciek Machnikowski --- phc2sys.8 | 4 phc2sys.c | 15 +++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/phc2sys.8 b/phc2sys.8 index 9277e01..963df83 100644 --- a/phc2sys.8 +++ b/phc2sys.8 @@ -323,6 +323,10 @@ Same as option .B \-E (see above

Re: [Linuxptp-devel] [PATCH v3] phc2sys: Add support for free-running mode

2022-07-25 Thread Maciek Machnikowski
On Sun, Jul 24, 2022 at 05:46:56PM -0700, Richard Cochran wrote: > On Tue, Jun 21, 2022 at 12:16:40PM +0200, Maciek Machnikowski wrote: > > > @@ -544,6 +546,9 @@ static void update_clock(struct phc2sys_private *priv, > > struct clock *clock, > > > > offset

[Linuxptp-devel] [PATCH v1] ts2phc: Enable corrections reporting in default log level

2022-07-28 Thread Maciek Machnikowski
-by: Maciek Machnikowski --- ts2phc_pps_sink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ts2phc_pps_sink.c b/ts2phc_pps_sink.c index 91bd7c9..80bc192 100644 --- a/ts2phc_pps_sink.c +++ b/ts2phc_pps_sink.c @@ -280,8 +280,8 @@ static int ts2phc_pps_sink_event(struct

[Linuxptp-devel] [PATCH v1] ts2phc: Print NMEA sentence used as ToD source in loglevel 6

2022-08-08 Thread Maciek Machnikowski
Print the G*RMC NMEA sentence that was correctly parsed and used as the ToD source in the default loglevel when the nmea source was used. This prevents printing all NMEA sentences available only in loglevel 7, and gives enough visibility on the state of GNSS receiver. Signed-off-by: Maciek

Re: [Linuxptp-devel] [PATCH 1/4] APTS support

2022-08-30 Thread Maciek Machnikowski
PHCs to the device. What is ts2phc using here vs the ptp4l that will make the decision on electing the right source clock? I took a look at the linkedin links you sent, but they don't explain it. Regards Maciek ___ Linuxptp-devel mailing li

Re: [Linuxptp-devel] [PATCH 2/4] APTS support

2022-08-30 Thread Maciek Machnikowski
fies the address of UNIX domain socket for virtual port as referred in > +G.8275 (Annex-B). The default is NULL. > +.TP Please be more verbose here. Specifies the address of the UNIX domain socket for communicating with the virtual PTP port on a PTP clock as defined in the G.8275 Annex B. The de

Re: [Linuxptp-devel] [PATCH 3/4] APTS support

2022-08-30 Thread Maciek Machnikowski
&ts2phc_vport->clockIdentity)) { > + pr_err("failed to set clock identity"); > + return NULL; > + } > + } > + This section add a lot of new arguments that are n

Re: [Linuxptp-devel] [PATCH 4/4] APTS support

2022-08-30 Thread Maciek Machnikowski
de it if the config file does not request this? Seems wasteful to me. Regards Maciek ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

[Linuxptp-devel] [PATCH v1] ts2phc: Add option to specify the ToD source in the config file

2022-10-04 Thread Maciek Machnikowski
e allowed. Signed-off-by: Maciek Machnikowski --- config.c | 1 + ts2phc.8 | 8 ts2phc.c | 12 3 files changed, 21 insertions(+) diff --git a/config.c b/config.c index e454c91..33176f4 100644 --- a/config.c +++ b/config.c @@ -330,6 +330,7 @@ struct config_item config_tab[]

Re: [Linuxptp-devel] [PATCH v1] ts2phc: Add option to specify the ToD source in the config file

2022-10-04 Thread Maciek Machnikowski
On Tue, Oct 04, 2022 at 06:34:20AM -0700, Richard Cochran wrote: > On Tue, Oct 04, 2022 at 10:30:58AM +0200, Maciek Machnikowski wrote: > > Current implementation requires specifying the -s argument for PPS > > sources that don't provide ToD information and for GNSS m

[Linuxptp-devel] [PATCH v2 2/3] ts2phc: Add option to specify the ToD source in the config file

2022-10-06 Thread Maciek Machnikowski
From: Maciej Machnikowski Current implementation requires specifying the -s argument for PPS sources that don't provide ToD information and for GNSS modules. Add ts2phc.tod_source config option to enable specifying the source in the config file. Currently only "generic" and "nmea" options are al

[Linuxptp-devel] [PATCH v2 3/3] ts2phc: Use system time as the default ToD source

2022-10-06 Thread Maciek Machnikowski
From: Maciej Machnikowski If no other Time of Day source is specified use the system timer by default. Signed-off-by: Maciej Machnikowski --- config.c | 2 +- ts2phc.8 | 1 + ts2phc.c | 6 -- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/config.c b/config.c index 33176f4..

[Linuxptp-devel] [PATCH v2 1/3] ts2phc: Rename pps_sink to tod_sink in main()

2022-10-06 Thread Maciek Machnikowski
From: Maciej Machnikowski Rename pps_sink to tod_sink, as it stores the source of the time of day Signed-off-by: Maciej Machnikowski --- ts2phc.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/ts2phc.c b/ts2phc.c index f7a57e4..67f2de6 100644 --- a/ts2

[Linuxptp-devel] [PATCH v1] phc2sys: Update TAI to UTC offset in manual

2022-10-17 Thread Maciek Machnikowski
To avoid confusion - update offset in the man page to current value. Signed-off-by: Maciek Machnikowski --- phc2sys.8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phc2sys.8 b/phc2sys.8 index 963df83..6de2d25 100644 --- a/phc2sys.8 +++ b/phc2sys.8 @@ -465,7 +465,7

Re: [Linuxptp-devel] [PATCH] Inclusion of a virtual PTP port on a PTP clock

2022-10-17 Thread Maciek Machnikowski
et presented by ts2phc should change and the BMCA should kick in changing the time source in the tree. Regards Maciek ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

[Linuxptp-devel] [PATCH v1] ts2phc: Update default lstab expiry date

2022-10-17 Thread Maciek Machnikowski
Update leap second table expiry date to 28 June 2023 based on the latest leap-seconds.list from IETF https://www.ietf.org/timezones/data/leap-seconds.list This fixes the need to give leapfile when running ts2phc with the NMEA source. Signed-off-by: Maciek Machnikowski --- lstab.c | 2 +- 1

Re: [Linuxptp-devel] [PATCH] Inclusion of a virtual PTP port on a PTP clock

2022-10-18 Thread Maciek Machnikowski
ur GNSS receiver). To address that we need some channel between ts2phc and ptp4l. The easiest way to implement it is to use existing PMC protocol and send the correct dataset to the ptp4l whenever the PPS is correct, and change it to the lower spec when it's not. That could reuse exisitng channel recently added to ts2phc for dynamic PPS reconfiguration. Regards Maciek ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

[Linuxptp-devel] [PATCH v1 0/3] Fix TAI offset in generic pps source

2022-10-18 Thread Maciek Machnikowski
logic that was applied to nmea source also to the generic, when the value read from system is incorrect. Signed-off-by: Maciek Machnikowski Maciek Machnikowski (3): lstab: Add LSTAB_EXPIRED result lstab: move update_leapsecond_table function to lstab ts2phc: Fix generic pps source when tai o

[Linuxptp-devel] [PATCH v1 2/3] lstab: move update_leapsecond_table function to lstab

2022-10-18 Thread Maciek Machnikowski
To enable handling lstab in the same way by different pps sources, move update_leapsecond_table function from the nmea_pps_source to the generic lstab file. This also required moving leapfile filename and its modification time to the struct lstab. Signed-off-by: Maciek Machnikowski --- lstab.c

[Linuxptp-devel] [PATCH v1 3/3] ts2phc: Fix generic pps source when tai offset is not set in OS

2022-10-18 Thread Maciek Machnikowski
used when the tai offset read from system is 0. Signed-off-by: Maciek Machnikowski --- ts2phc_generic_pps_source.c | 83 + 1 file changed, 76 insertions(+), 7 deletions(-) diff --git a/ts2phc_generic_pps_source.c b/ts2phc_generic_pps_source.c index 6842d8e

[Linuxptp-devel] [PATCH v1 1/3] lstab: Add LSTAB_EXPIRED result

2022-10-18 Thread Maciek Machnikowski
LSTAB_UNKNOWN is too generic, add LSTAB_EXPIRED result to return the latest lstab correction and indicate that the tab used to resolve it is expired. This is useful for more precise reporting of lstab file state and will enable an override of expired table. Signed-off-by: Maciek Machnikowski

Re: [Linuxptp-devel] [PATCH v1 0/3] Fix TAI offset in generic pps source

2022-10-20 Thread Maciek Machnikowski
On Wed, Oct 19, 2022 at 05:22:33PM -0700, Jacob Keller wrote: > > > On 10/18/2022 8:08 AM, Maciek Machnikowski wrote: > > Current implementation of generic pps source relies on the UTC-TAI offset > > read > > from system. Some OSes don't set that offset by de

Re: [Linuxptp-devel] [PATCH] phc_ctl: add pin_cfg command to display pin functions

2022-10-31 Thread Maciek Machnikowski
; + pin_desc.name); > + } else { > + pr_notice("pin %d [%s] performing %s using channel %d", Remove "performing" to avoid wordiness :) But a very useful addition! Regards Maciek ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Re: [Linuxptp-devel] [PATCH v2] ptp4l: Add profile_id configuration support for G.8275.1 and G.8275.2.

2022-11-02 Thread Maciek Machnikowski
- 00-19-A7-02-01-02 (for an implementation based on IEEE Std 1588-2019 [IEEE 1588-2019]) Regards Maciek ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Re: [Linuxptp-devel] [PATCH 2/4] Add sock servo.

2022-11-14 Thread Maciek Machnikowski
t; use it. > > > > Yea, but I feel that just "sock" is vague. I'm not totally opposed to it > though. What about rcl_sock or refclock_sock? It's used in the file linked by Miroslav. Regards Maciek ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

[Linuxptp-devel] [PATCH v2 0/3] Fix TAI offset in generic pps source

2022-12-12 Thread Maciek Machnikowski
logic that was applied to nmea source also to the generic, when the value read from system is incorrect. v2: Fixes after Richard's review Signed-off-by: Maciek Machnikowski Maciek Machnikowski (3): lstab: Add LSTAB_EXPIRED result lstab: move update_leapsecond_table function to lstab t

[Linuxptp-devel] [PATCH v2 3/3] ts2phc: Fix generic pps source when tai offset is not set in OS

2022-12-12 Thread Maciek Machnikowski
used when the tai offset read from system is 0. Signed-off-by: Maciek Machnikowski Reviewed-by: Jacob Keller --- ts2phc_generic_pps_source.c | 83 + 1 file changed, 76 insertions(+), 7 deletions(-) diff --git a/ts2phc_generic_pps_source.c b

[Linuxptp-devel] [PATCH v2 2/3] lstab: move update_leapsecond_table function to lstab

2022-12-12 Thread Maciek Machnikowski
To enable handling lstab in the same way by different pps sources, move update_leapsecond_table function from the nmea_pps_source to the generic lstab file. This also required moving leapfile filename and its modification time to the struct lstab. Signed-off-by: Maciek Machnikowski Reviewed-by

[Linuxptp-devel] [PATCH v2 1/3] lstab: Add LSTAB_EXPIRED result

2022-12-12 Thread Maciek Machnikowski
LSTAB_UNKNOWN is too generic, add LSTAB_EXPIRED result to return the latest lstab correction and indicate that the tab used to resolve it is expired. This is useful for more precise reporting of lstab file state and will enable an override of expired table. Signed-off-by: Maciek Machnikowski

Re: [Linuxptp-devel] [PATCH v2 1/1] clock: Fix stale clock parent pid usage after best master change

2022-12-13 Thread Maciek Machnikowski
On 12/9/2022 1:56 AM, vincent.cheng...@renesas.com wrote: > From: Vincent Cheng > Please add a short description to the patch (ex. the problem and solution from the cover letter), as the description from the cover letter will not get to the git repo. > Signed-off-by: Vincent Cheng > --- >

[Linuxptp-devel] [PATCH v3 2/3] lstab: move update_leapsecond_table function to lstab

2023-02-08 Thread Maciek Machnikowski
To enable handling lstab in the same way by different pps sources, move update_leapsecond_table function from the nmea_pps_source to the generic lstab file. This also required moving leapfile filename and its modification time to the struct lstab. Signed-off-by: Maciek Machnikowski Reviewed-by

[Linuxptp-devel] [PATCH v3 3/3] ts2phc: Fix generic pps source when tai offset is not set in OS

2023-02-08 Thread Maciek Machnikowski
used when the tai offset read from system is 0. Signed-off-by: Maciek Machnikowski Reviewed-by: Jacob Keller Signed-off-by: Maciek Machnikowski --- ts2phc_generic_pps_source.c | 83 + 1 file changed, 76 insertions(+), 7 deletions(-) diff --git a

[Linuxptp-devel] [PATCH v3 1/3] lstab: Add LSTAB_EXPIRED result

2023-02-08 Thread Maciek Machnikowski
LSTAB_UNKNOWN is too generic, add LSTAB_EXPIRED result to return the latest lstab correction and indicate that the tab used to resolve it is expired. This is useful for more precise reporting of lstab file state and will enable an override of expired table. Signed-off-by: Maciek Machnikowski

[Linuxptp-devel] [PATCH v3 0/3] Fix TAI offset in generic pps source

2023-02-08 Thread Maciek Machnikowski
logic that was applied to nmea source also to the generic, when the value read from system is incorrect. v2: Fixes after Richard's review v3: Fixed static function conflicting with header Maciek Machnikowski (3): lstab: Add LSTAB_EXPIRED result lstab: move update_leapsecond_table functio

Re: [Linuxptp-devel] [PATCH v6 00/10] Dynamic sync direction for ts2phc

2023-02-28 Thread Maciek Machnikowski
] I just got back to this patch series and realized that this config file didn't make it to the example configs. Can we add it to the configs/ts2phc*.cfg for the 4.0 release? Thanks, Maciek ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

[Linuxptp-devel] [PATCH v1 1/2] msg: Enable changing PTP message header version

2023-03-07 Thread Maciek Machnikowski
Some hardware can't properly timestamp packets with the new PTP header version 2.1. This patch introduces a global var ptp_hdr_ver that can be changed externally to allow legacy PTP version to be advertised. Signed-off-by: Maciek Machnikowski --- msg.c | 1 + msg.h | 5 + port.c

[Linuxptp-devel] [PATCH v1 2/2] ptp4l: Allow advertisement of legacy PTP 2.0 protocol

2023-03-07 Thread Maciek Machnikowski
Some hardware can't properly timestamp packets with the new PTP header version 2.1. This patch adds legacy_ptp_ver config option that allows advertising of the legacy 2.0 protocol. Signed-off-by: Maciek Machnikowski --- config.c| 1 + configs/default.cfg | 1 + pt

[Linuxptp-devel] [PATCH v1] ts2phc: Fix potential null-pointer dereference

2023-03-13 Thread Maciek Machnikowski
An unallocated pmc_agent may be dereferenced in the pmc_agent_destroy called by the ts2phc_cleanup(). Check if the agent was allocated before releasing it. Signed-off-by: Maciek Machnikowski --- ts2phc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ts2phc.c b/ts2phc.c

[Linuxptp-devel] [PATCH v2] ts2phc: Fix potential null-pointer dereference

2023-03-13 Thread Maciek Machnikowski
An unallocated pmc_agent may be dereferenced in the pmc_agent_destroy called by the ts2phc_cleanup(). Check if the agent was allocated before releasing it. v2: Fixed coding standard Signed-off-by: Maciek Machnikowski --- ts2phc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[Linuxptp-devel] [PATCH v1] ntpshm: Invalidate SHM data before releasing the servo

2023-03-15 Thread Maciek Machnikowski
releasing the SHM servo. Signed-off-by: Maciek Machnikowski --- ntpshm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ntpshm.c b/ntpshm.c index 3b62a3f..6453ac4 100644 --- a/ntpshm.c +++ b/ntpshm.c @@ -69,6 +69,9 @@ static void ntpshm_destroy(struct servo *servo) { struct

Re: [Linuxptp-devel] [PATCH v1] ntpshm: Invalidate SHM data before releasing the servo

2023-03-15 Thread Maciek Machnikowski
On 15/03/2023 13:51, Miroslav Lichvar wrote: > On Wed, Mar 15, 2023 at 12:55:56PM +0100, Maciek Machnikowski wrote: >> The SHM is not cleared upon servo release when exiting the tool. This leaves >> the last update in the shared memory region marked as valid. As a result, th

Re: [Linuxptp-devel] [PATCH v1] ntpshm: Invalidate SHM data before releasing the servo

2023-03-16 Thread Maciek Machnikowski
On 16/03/2023 09:37, Miroslav Lichvar wrote: > On Wed, Mar 15, 2023 at 05:44:43PM +0100, Maciek Machnikowski wrote: >> If you start the synchronization process and see that it doesn't work >> correctly then, this cleanup will prevent leaving invalid timestamps in >> m

[Linuxptp-devel] [PATCH v2] ntpshm: Invalidate SHM data before releasing the servo

2023-03-16 Thread Maciek Machnikowski
system suspend), an incorrec timestamp might be accepted by the consumer To prevent such behavior - invalidate the SHM data when releasing the SHM servo. v2: Fix commit message Signed-off-by: Maciek Machnikowski --- ntpshm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ntpshm.c b/ntpshm.c

[Linuxptp-devel] [PATCH v1 2/2] ts2phc: Add PTP as a source of ToD

2023-03-31 Thread Maciek Machnikowski
ing 1 --slave_event_monitor /var/run/ts2phc-mon Note: Do not enable ptp4l control of the clock on the same port. Signed-off-by: Maciek Machnikowski --- makefile| 3 +- ts2phc.8| 6 ++ ts2phc.c| 2 + ts2phc_pps_source.c | 4 + ts2phc_pps_sou

[Linuxptp-devel] [PATCH v1 1/2] pmc_agent: Add callback for signaling messages

2023-03-31 Thread Maciek Machnikowski
Add callback that will act on signaling messages. Signed-off-by: Maciek Machnikowski --- phc2sys.c | 4 ++-- pmc_agent.c | 17 - pmc_agent.h | 7 +-- ts2phc.c| 2 +- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/phc2sys.c b/phc2sys.c index 19e8012

Re: [Linuxptp-devel] [PATCH v1 1/2] pmc_agent: Add callback for signaling messages

2023-04-05 Thread Maciek Machnikowski
On 4/2/2023 1:48 PM, Erez wrote: > On Fri, 31 Mar 2023 at 13:35, Maciek Machnikowski > mailto:mac...@machnikowski.net>> wrote: > > Add callback that will act on signaling messages. > > > Adding a second callback seems like an unnecessary overhead. > All you

[Linuxptp-devel] [PATCH v2 2/2] ts2phc: Add PTP as a source of ToD

2023-04-07 Thread Maciek Machnikowski
ing 1 --slave_event_monitor /var/run/ts2phc-mon Note: Do not enable ptp4l control of the clock on the same port. Signed-off-by: Maciek Machnikowski --- makefile| 3 +- ts2phc.8| 6 ++ ts2phc.c| 2 + ts2phc_pps_source.c | 4 + ts2phc_pps_sou

[Linuxptp-devel] [PATCH v2 1/2] pmc_agent: Add option to run callback for signaling messages

2023-04-07 Thread Maciek Machnikowski
Add option to run callback that when the PMC agent receives signaling messages. Signed-off-by: Maciek Machnikowski --- pmc_agent.c | 19 ++- pmc_agent.h | 7 +++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/pmc_agent.c b/pmc_agent.c index 62d1a86..7ffcec8

Re: [Linuxptp-devel] [PATCH v2 1/2] pmc_agent: Add option to run callback for signaling messages

2023-04-11 Thread Maciek Machnikowski
ecame - I decided to add a new variable to address the readability of this part of the code. I don't like abusing res to get fewer lines of code :) Thanks, Maciek ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

[Linuxptp-devel] [PATCH v3 1/2] pmc_agent: Add option to run callback for signaling messages

2023-04-11 Thread Maciek Machnikowski
Add option to run callback that when the PMC agent receives signaling messages. Signed-off-by: Maciek Machnikowski --- pmc_agent.c | 19 ++- pmc_agent.h | 7 +++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/pmc_agent.c b/pmc_agent.c index 62d1a86..7ffcec8

[Linuxptp-devel] [PATCH v3 2/2] ts2phc: Add PTP as a source of ToD

2023-04-11 Thread Maciek Machnikowski
ing 1 --slave_event_monitor /var/run/ts2phc-mon Note: Do not enable ptp4l control of the clock on the same port. v2: changed pmc_agent implementation to not use a separate callback v3: updated poll thread to use less CPU Signed-off-by: Maciek Machnikowski --- makefile| 3 +- ts2

[Linuxptp-devel] [PATCH v1] ts2phc: Prevent reporting poll error when received termination signal

2023-04-11 Thread Maciek Machnikowski
ned-off-by: Maciek Machnikowski --- ts2phc.c | 3 ++- ts2phc_pps_sink.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ts2phc.c b/ts2phc.c index 4393059..7d19de6 100644 --- a/ts2phc.c +++ b/ts2phc.c @@ -763,7 +763,8 @@ int main(int argc, char *argv[])

Re: [Linuxptp-devel] [PATCH v1] ts2phc: Prevent reporting poll error when received termination signal

2023-04-11 Thread Maciek Machnikowski
On 4/11/2023 2:52 PM, Jürgen Appel wrote: > Dear Maciek, > > On Tuesday, 11 April 2023 11:19:50 CEST, you wrote: > >> Currently ts2phc prints "poll failed" error to the LOG_EMERG when >> the poll for tod fails. This causes error print on all terminals >

[Linuxptp-devel] [PATCH v2] ts2phc: Prevent reporting poll error when received termination signal

2023-04-11 Thread Maciek Machnikowski
Currently ts2phc prints "poll failed" error to the LOG_EMERG when the poll for tod fails. This causes error print on all terminals when the tool gets terminated using SIGINT (ex. by pressing CTRL+C). v2: Properly handle poll interrupt to prevent the error Signed-off-by: Maciek Ma

[Linuxptp-devel] [PATCH v1] tz2alt: Add tz2alt to .gitignore

2023-04-11 Thread Maciek Machnikowski
Add tz2alt to .gitignore list Signed-off-by: Maciek Machnikowski --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1e7d1ca..8d3e171 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ /snmp4lptp /timemaster /ts2phc +/tz2alt -- 2.30.2

Re: [Linuxptp-devel] [PATCH v3 2/2] ts2phc: Add PTP as a source of ToD

2023-04-11 Thread Maciek Machnikowski
On 4/11/2023 3:20 PM, Jakub Raczyński wrote: > Dear Maciek, > >> +if (ts - s->last_update >= TOD_UPDATE_INTERVAL) { >> +pmc_agent_update(s->agent); >> +s->last_update = ts; >> +}

[Linuxptp-devel] [PATCH v4 2/2] ts2phc: Add PTP as a source of ToD

2023-04-11 Thread Maciek Machnikowski
ing 1 --slave_event_monitor /var/run/ts2phc-mon Note: Do not enable ptp4l control of the clock on the same port. v2: changed pmc_agent implementation to not use a separate callback v3: updated poll thread to use less CPU v4: changed sleep routine to usleep, simplified poll thread Signed-off-by: M

[Linuxptp-devel] [PATCH v4 1/2] pmc_agent: Add option to run callback for signaling messages

2023-04-11 Thread Maciek Machnikowski
Add option to run callback that when the PMC agent receives signaling messages. Signed-off-by: Maciek Machnikowski --- pmc_agent.c | 19 ++- pmc_agent.h | 7 +++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/pmc_agent.c b/pmc_agent.c index 62d1a86..7ffcec8

Re: [Linuxptp-devel] [PATCH v2 0/1] Last (?) patch before version 4 release

2023-04-19 Thread Maciek Machnikowski
inuxptp/mailman/message/37789671/ As a potential null-pointer dereference (it may happen when the agent was not allocated due to lack of memory and the cleanup gets called as a result) Thanks, Maciek > > ___ > Linuxptp-devel mailing list >

Re: [Linuxptp-devel] [PATCH v2 1/2] pmc_agent: Add option to run callback for signaling messages

2023-04-20 Thread Maciek Machnikowski
On 4/17/2023 3:24 PM, Erez wrote: > > > On Mon, 17 Apr 2023 at 15:21, Maciek Machnikowski > mailto:mac...@machnikowski.net>> wrote: > > > > On 4/14/2023 2:58 PM, Erez wrote: > > > > > > On Tue, 11 Apr 2023 at 10:28, Maciek Mac

[Linuxptp-devel] [PATCH v5 2/2] ts2phc: Add PTP as a source of ToD

2023-04-20 Thread Maciek Machnikowski
sure management_tlv_id is not called on non-management messages Signed-off-by: Maciek Machnikowski --- makefile| 3 +- ts2phc.8| 6 ++ ts2phc.c| 2 + ts2phc_pps_source.c | 4 + ts2phc_pps_source.h | 1 + ts2phc_ptp_pps_source.c

[Linuxptp-devel] [PATCH v5 1/2] pmc_agent: Add option to run callback for signaling messages

2023-04-20 Thread Maciek Machnikowski
Add option to run callback that when the PMC agent receives signaling messages. Signed-off-by: Maciek Machnikowski --- pmc_agent.c | 21 +++-- pmc_agent.h | 7 +++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/pmc_agent.c b/pmc_agent.c index 62d1a86

Re: [Linuxptp-devel] [PATCH v2 0/1] Last (?) patch before version 4 release

2023-04-26 Thread Maciek Machnikowski
On 4/19/2023 11:43 AM, Maciek Machnikowski wrote: > On 4/17/2023 4:34 PM, Richard Cochran wrote: >> On Mon, Apr 17, 2023 at 11:07:10AM +0200, Miroslav Lichvar wrote: >> >>> As for the 4.0 release, can you please have a look at this bug fix? >>> https://ww

Re: [Linuxptp-devel] [PATCH v5 1/2] pmc_agent: Add option to run callback for signaling messages

2023-04-26 Thread Maciek Machnikowski
On 4/21/2023 6:46 PM, Erez wrote: > > > On Fri, 21 Apr 2023 at 17:27, Maciek Machnikowski > mailto:mac...@machnikowski.net>> wrote: > > On 4/21/2023 1:25 PM, Erez wrote: > > > > > > On Thu, 20 Apr 2023 at 19:01, Maciek Machnikow

[Linuxptp-devel] [PATCH v6 1/2] pmc_agent: Add option to run callback for signaling messages

2023-04-26 Thread Maciek Machnikowski
non-management messages v6: optimized code to not check signaling_cb_ena on management messages Signed-off-by: Maciek Machnikowski --- pmc_agent.c | 22 -- pmc_agent.h | 7 +++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/pmc_agent.c b/pmc_agent.c index

[Linuxptp-devel] [PATCH v6 2/2] ts2phc: Add PTP as a source of ToD

2023-04-26 Thread Maciek Machnikowski
sure management_tlv_id is not called on non-management messages v6: optimized code to not check signaling_cb_ena on management messages Signed-off-by: Maciek Machnikowski --- makefile| 3 +- ts2phc.8| 6 ++ ts2phc.c| 2 + ts2phc_pps_source.c

[Linuxptp-devel] [PATCH v1] lstab: Update leapfile validity

2023-04-27 Thread Maciek Machnikowski
No leap seconds will happen till the end of 2023. Update leapfile validity accordingly. Signed-off-by: Maciek Machnikowski --- lstab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lstab.c b/lstab.c index facf3e4..df8cce0 100644 --- a/lstab.c +++ b/lstab.c @@ -51,7 +51,7

Re: [Linuxptp-devel] Can ptp4l specify master clock source by ip address?

2023-06-03 Thread Maciek Machnikowski
which would be one more thing > for the system configurators to get wrong when deploying them. > > TLDR; can a 'slaveOnly' ptp4l client specify the ip (ipv4) address of > the master clock it wants to use? TLDR; Yes - if you deploy it in unicast mode :) Thanks, Maciek > >

Re: [Linuxptp-devel] [PATCH] Use the peerDelay computation specified in 802.1AS when transportSpecific value is 1 and the clock domain is 0.

2023-06-06 Thread Maciek Machnikowski
& Can we do the #define for that instead of (1<<4)? > + (clock_domain_number(p->clock) == 0)) { Why we require clock domain to be 0? AFIK the 802.1AS-2020 added support for multiple domains. Also the comment talks that the code should check the ptp_header.reserved1, bu

Re: [Linuxptp-devel] [PATCH RFC 1/5] Rename NSEC2SEC as NSEC_PER_SEC

2023-06-07 Thread Maciek Machnikowski
. Maybe NSEC_PER_SEC_F would work better? Or just add the cast in one place that requires float? Also - wouldn't it be better to move it to the util.h and have it in one place? Thanks, Maciek > > > Signed-off-by: Rahul Rameshbabu <mailto:rrameshb...@nvidia.com&

[Linuxptp-devel] [PATCH v1] servo: Implement offset statistics

2023-07-03 Thread Maciek Machnikowski
parameters and prints basic offset min/avg/max/stddev/rms stats on servo destroy call (when the tool is treminated). Signed-off-by: Maciek Machnikowski --- makefile| 2 +- servo.c | 42 ++ servo_private.h | 6 ++ 3 files changed, 49

Re: [Linuxptp-devel] [PATCH v1] servo: Implement offset statistics

2023-07-10 Thread Maciek Machnikowski
On 7/10/2023 10:33 AM, Miroslav Lichvar wrote: > On Mon, Jul 03, 2023 at 04:18:57PM +0200, Maciek Machnikowski wrote: >> Currently running servo reports current offsets in numerous tools, but lacks >> statistical data. Having the basic statistical data makes it easier to >&g

Re: [Linuxptp-devel] [PATCH v1] servo: Implement offset statistics

2023-07-10 Thread Maciek Machnikowski
On 7/10/2023 12:03 PM, Miroslav Lichvar wrote: > On Mon, Jul 10, 2023 at 11:18:36AM +0200, Maciek Machnikowski wrote: >> Do you mean the one in clock.c? If so, the clock_stats_display resets >> them, so there's no way of printing the stats from a whole run - >> especia

Re: [Linuxptp-devel] [PATCH] sk: don't report random errno on timeout

2023-07-18 Thread Maciek Machnikowski
ing tx_timestamp_timeout or increasing kworker threads priority may correct this issue, but a driver bug likely causes it That would work if we also add the instruction how to do that in the manual. Otherwise we'll get the same number of questions - just different ones :) Thanks, Maciek >

Re: [Linuxptp-devel] [PATCH v1] servo: Implement offset statistics

2023-07-21 Thread Maciek Machnikowski
On 7/10/2023 12:33 PM, Maciek Machnikowski wrote: > > > On 7/10/2023 12:03 PM, Miroslav Lichvar wrote: >> On Mon, Jul 10, 2023 at 11:18:36AM +0200, Maciek Machnikowski wrote: >>> Do you mean the one in clock.c? If so, the clock_stats_display resets >>> them,

[Linuxptp-devel] [RESEND v5 1/2] pmc_agent: Add option to run callback for signaling messages

2023-08-08 Thread Maciek Machnikowski
Add option to run callback that when the PMC agent receives signaling messages. Signed-off-by: Maciek Machnikowski --- pmc_agent.c | 19 ++- pmc_agent.h | 7 +++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/pmc_agent.c b/pmc_agent.c index 62d1a86..7ffcec8

[Linuxptp-devel] [RESEND v5 2/2] ts2phc: Add PTP as a source of ToD

2023-08-08 Thread Maciek Machnikowski
ing 1 --slave_event_monitor /var/run/ts2phc-mon Note: Do not enable ptp4l control of the clock on the same port. v2: changed pmc_agent implementation to not use a separate callback v3: updated poll thread to use less CPU v4: changed sleep routine to usleep, simplified poll thread Signed-off-by: M

[Linuxptp-devel] [PATCH v1] pi: Fix drift history when entering SERVO_LOCKED state

2023-08-18 Thread Maciek Machnikowski
the lock needs more time to stabilize when the frequency offset is very large (ex. set to extreme values with phc_ctl) or may totally prevent servo from correctly locking. This patch fixes the s->drift when entering the stable state to hold the scaled drift. Signed-off-by: Maciek Machnikowski -

Re: [Linuxptp-devel] [PATCH v1] pi: Fix drift history when entering SERVO_LOCKED state

2023-08-21 Thread Maciek Machnikowski
On 8/21/2023 2:04 PM, Miroslav Lichvar wrote: > On Fri, Aug 18, 2023 at 12:31:47PM +0200, Maciek Machnikowski wrote: >> Current implementation saves s->drift as an offset between current clock >> frequency and the remote clock frequency calculated on first two samples. >>

Re: [Linuxptp-devel] [PATCH v1] pi: Fix drift history when entering SERVO_LOCKED state

2023-08-22 Thread Maciek Machnikowski
On 8/22/2023 11:24 AM, Miroslav Lichvar wrote: > On Mon, Aug 21, 2023 at 07:02:55PM +0200, Maciek Machnikowski wrote: >> On 8/21/2023 2:04 PM, Miroslav Lichvar wrote: >>> s->drift is the drift of the uncompensated clock. It's not supposed to be >>> scaled by

Re: [Linuxptp-devel] [PATCH v1] pi: Fix drift history when entering SERVO_LOCKED state

2023-08-22 Thread Maciek Machnikowski
On 8/22/2023 1:50 PM, Miroslav Lichvar wrote: > On Tue, Aug 22, 2023 at 12:34:35PM +0200, Maciek Machnikowski wrote: >> root@equinox:[~]#: phc_ctl ens6f0np0 set freq 5000 >> root@equinox:[~]#: sudo ptp4l -m -i ens6f0np0 -2 -s > >> ptp4l[248.614]: master offset -301

Re: [Linuxptp-devel] [RESEND v5 2/2] ts2phc: Add PTP as a source of ToD

2023-09-04 Thread Maciek Machnikowski
On 9/4/2023 1:01 AM, Richard Cochran wrote: > On Tue, Aug 08, 2023 at 11:36:52AM +0200, Maciek Machnikowski wrote: > >> v2: changed pmc_agent implementation to not use a separate callback >> v3: updated poll thread to use less CPU >> v4: changed sleep routine to usleep

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

2023-09-13 Thread Maciek Machnikowski
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. Signed-off-by: Maciek Machnikowski --- phc_ctl.8 | 13 +++- phc_ctl.c | 92

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

2023-11-10 Thread Maciek Machnikowski
On 11/10/2023 7:02 AM, Richard Cochran wrote: > On Wed, Sep 13, 2023 at 05:09:04PM +0000, 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

[Linuxptp-devel] [PATCH v2 1/2] Some hardware can't properly timestamp packets with the new PTP header version 2.1. This patch introduces a global var ptp_hdr_ver that can be changed externally to all

2023-11-10 Thread Maciek Machnikowski
Forcing 2.1 also breaks interoperability with some older grandmasters which will ignore packets with ptp_minor version set. Signed-off-by: Maciek Machnikowski --- msg.c | 1 + msg.h | 5 + port.c | 18 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a

[Linuxptp-devel] [PATCH v2 2/2] Some hardware can't properly timestamp packets with the new PTP header version 2.1. This patch adds legacy_ptp_ver config option that allows advertising of the legacy 2

2023-11-10 Thread Maciek Machnikowski
Additionally, forcing PTP minor version to be nonzero causes interoperability issues with some legacy grandmasters. Signed-off-by: Maciek Machnikowski --- config.c| 1 + configs/default.cfg | 1 + ptp4l.8 | 5 + ptp4l.c | 4 4 files changed, 11

[Linuxptp-devel] [PATCH v3 1/2] msg: Enable changing PTP message header version

2023-11-10 Thread Maciek Machnikowski
gnore packets with ptp_minor version set. v2: clarify compatibility issue caused by the change v3: fix subject line Signed-off-by: Maciek Machnikowski --- msg.c | 1 + msg.h | 5 + port.c | 18 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/msg.c b/

[Linuxptp-devel] [PATCH v3 2/2] ptp4l: Allow advertisement of legacy PTP 2.0 protocol

2023-11-10 Thread Maciek Machnikowski
sters. v2: rebase on top, clarify compatibility issues v3: fix subject line Signed-off-by: Maciek Machnikowski --- config.c| 1 + configs/default.cfg | 1 + ptp4l.8 | 5 + ptp4l.c | 4 4 files changed, 11 insertions(+) diff --git a/config.c b/config.c

Re: [Linuxptp-devel] [PATCH v3 1/2] msg: Enable changing PTP message header version

2023-11-10 Thread Maciek Machnikowski
packets to the 2.1 delay-req which will cause some hw to still not generate timestamps > > 2) The major and  version numbers are explicit port level options NAK the standard says that version is implemented by the PTP Instance issuing a PTP message, not a per-port option. Thanks, Maciek

[Linuxptp-devel] [PATCH v7 1/2] pmc_agent: Add option to run callback for signaling messages

2023-11-10 Thread Maciek Machnikowski
non-management messages v6: optimized code to not check signaling_cb_ena on management messages v7: rebase Signed-off-by: Maciek Machnikowski --- pmc_agent.c | 22 -- pmc_agent.h | 7 +++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/pmc_agent.c b

[Linuxptp-devel] [PATCH v7 2/2] ts2phc: Add PTP as a source of ToD

2023-11-10 Thread Maciek Machnikowski
sure management_tlv_id is not called on non-management messages v6: optimized code to not check signaling_cb_ena on management messages v7: rebase Signed-off-by: Maciek Machnikowski --- makefile| 3 +- ts2phc.8| 6 ++ ts2phc.c| 2 + ts2phc_pps_source.c

  1   2   >