Re: [Linuxptp-devel] [PATCH v2] Add support for DELAY_REQ and SYNC packets RX filters

2023-11-29 Thread Vladimir Oltean
Hi Ilia, On Fri, Nov 24, 2023 at 10:29:12PM +0300, IlorDash wrote: > From: Ilya Orazov > > I’m using an Ethernet controller with PTP support, which requires > determining which PTP packets on RX must be timestamped: SYNC or > DELAY_REQ, based on whether the device is Slave or Master

Re: [Linuxptp-devel] [PATCH] Add option to bind raw and UDP sockets to interface

2023-03-14 Thread Vladimir Oltean
On Tue, Mar 14, 2023 at 12:25:18PM -0700, Richard Cochran wrote: > On Tue, Mar 14, 2023 at 12:38:06PM +0200, Kamil Zaripov wrote: > > Can you explain the problems you see with timestamping in the interface on > > top of a bridge? > > When a MAC joins a bridge, the MAC is no longer avaiable as a

Re: [Linuxptp-devel] [PATCH] Add option to bind raw and UDP sockets to interface

2023-03-14 Thread Vladimir Oltean
On Tue, Mar 14, 2023 at 12:38:06PM +0200, Kamil Zaripov wrote: > > On 13 Mar 2023, at 20:35, Richard Cochran wrote: > > > > "It works for me" is not a strong argument. This software stack must > > work for everyone. > > I agree that “It works for me” is not enough to merge this patch. > > >

Re: [Linuxptp-devel] Code freeze for 4.0 release

2023-02-22 Thread Vladimir Oltean
Hi Richard, On Wed, Feb 22, 2023 at 07:03:59AM -0800, Richard Cochran wrote: > Dear Devs, > > I'll be releasing 4.0 in the next day or two. I won't be taking any > new stuff until after the release. If you have any last minute > critical bug fixes, please let me know ASAP. > > Thanks, >

[Linuxptp-devel] [PATCH v6 02/10] ts2phc: instantiate a full clock structure for every PPS sink

2022-08-30 Thread Vladimir Oltean
ck", and things that can timestamp external events should be represented by a "struct ts2phc_pps_sink". Signed-off-by: Vladimir Oltean --- v5->v6: - add back int fd to struct ts2phc_clock, and use it instead of CLOCKID_TO_FD every time v4->v5: - Rebased on top of data structu

[Linuxptp-devel] [PATCH v6 04/10] util: import port_state_normalize() logic from phc2sys

2022-08-30 Thread Vladimir Oltean
util.c for lack of a better place. Also add some comments and rewrite the implementation so that it is a bit more clear. No change intended in the produced code. Signed-off-by: Vladimir Oltean --- v5->v6: patch is new phc2sys.c | 18 +++--- util.c| 13 + uti

[Linuxptp-devel] [PATCH v6 08/10] ts2phc: reconfigure sync direction by subscribing to ptp4l port events

2022-08-30 Thread Vladimir Oltean
timestamp of the reference clock. All timestamps are representative of the same event, which is the most recent perout pulse of the PPS source. Signed-off-by: Vladimir Oltean --- v5->v6: - None. v4->v5: - Rename source clock to reference clock, destination clock to target clock - Rebase on top

[Linuxptp-devel] [PATCH v6 03/10] ts2phc: instantiate a full clock structure for every PPS source of the PHC kind

2022-08-30 Thread Vladimir Oltean
rt states, which in "automatic" mode are dynamic, as the name suggests). Signed-off-by: Vladimir Oltean --- v5->v6: - continue to use clock->fd as opposed to CLOCKID_TO_FD - some include file cleanups, stop touching ts2phc_pps_sink.c from a patch intended for PPS sources.

[Linuxptp-devel] [PATCH v6 07/10] ts2phc: split PPS sink poll from servo loop

2022-08-30 Thread Vladimir Oltean
it to be used by a PPS source as well (the PHC kind). Signed-off-by: Vladimir Oltean --- v5->v6: - freeing the pollfd array is now part of patch context rather than patch additions v4->v5: - Rebase on top of the variable renaming. v3->v4: - Use bool for boolean types. v2->v3: - None

[Linuxptp-devel] [PATCH v6 09/10] ts2phc: allow PHC PPS sources to be synchronized

2022-08-30 Thread Vladimir Oltean
, when in automatic mode. Signed-off-by: Vladimir Oltean --- v5->v6: - eliminate use of offensive word "approximation" v4->v5: - rebase on top of data structure renames v3->v4: Add one more paragraph to commit message. v2->v3: Implement ts2phc_master_get_clock() as part of t

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

2022-08-30 Thread Vladimir Oltean
ster.c where it should be. - Added justification in commit message for creating struct ts2phc_private. - Reordered headers alphabetically. Changes in v2: - Added Jacob's review tags, addressed some feedback. - Dropped patch "pmc_common: fix potential memory leak in run_pmc_events()&qu

[Linuxptp-devel] [PATCH v6 05/10] ts2phc: instantiate a pmc agent

2022-08-30 Thread Vladimir Oltean
e, and the other PHC devices turn into target clocks. Signed-off-by: Vladimir Oltean --- v5->v6: - use generic port_state_normalize() rather than ts2phc logic duplication - rename auto_init_ports() to ts2phc_auto_init_ports() - adapt to newly added phc_index argument to pmc_agent_query_port_prope

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

2022-08-30 Thread Vladimir Oltean
ster.c where it should be. - Added justification in commit message for creating struct ts2phc_private. - Reordered headers alphabetically. Changes in v2: - Added Jacob's review tags, addressed some feedback. - Dropped patch "pmc_common: fix potential memory leak in run_pmc_events()&qu

[Linuxptp-devel] [PATCH v6 01/10] ts2phc: create a private data structure

2022-08-30 Thread Vladimir Oltean
of being synchronized. So instead of having the translation modules of ts2phc communicate through global variables, let's make struct ts2phc_private the common working space for the entire program, which is a paradigm that is more natural. Signed-off-by: Vladimir Oltean Reviewed-by: Jacob Keller

[Linuxptp-devel] [PATCH v6 10/10] ts2phc_phc_pps_source: make use of new kernel API for perout waveform

2022-08-30 Thread Vladimir Oltean
implicit deduction of the precise perout timestamp. We put that code into a common function and convert all call sites to call that. We also need to do the same thing for the edge ignoring logic. Signed-off-by: Vladimir Oltean --- v5->v6: - eliminate use of offensive word "approximate" - co

[Linuxptp-devel] [PATCH v6 06/10] ts2phc_slave: print offset to the source clock

2022-08-30 Thread Vladimir Oltean
Make this information more visible by default, since it is the key output of this program. Signed-off-by: Vladimir Oltean Reviewed-by: Jacob Keller --- v5->v6: none v4->v5: rebase on top of the variable renames v1->v4: none ts2phc_pps_sink.c | 4 ++-- 1 file changed, 2 inserti

Re: [Linuxptp-devel] [PATCH v5 07/13] ts2phc: instantiate a full clock structure for every PPS source of the PHC kind

2022-08-05 Thread Vladimir Oltean
On Mon, Jun 13, 2022 at 03:27:13PM -0700, Richard Cochran wrote: > On Tue, Nov 23, 2021 at 02:14:15AM +0200, Vladimir Oltean wrote: > > > diff --git a/ts2phc_phc_pps_source.c b/ts2phc_phc_pps_source.c > > index ffb96ef7299a..fca653f99499 100644 > > --- a/ts2phc_ph

Re: [Linuxptp-devel] [PATCH v5 08/13] ts2phc: instantiate a pmc agent

2022-08-05 Thread Vladimir Oltean
On Tue, Jun 14, 2022 at 05:58:13AM -0700, Richard Cochran wrote: > On Tue, Nov 23, 2021 at 02:14:16AM +0200, Vladimir Oltean wrote: > > > +static enum port_state ts2phc_normalize_state(enum port_state state) > > +{ > > + if (state != PS_MASTER && state

Re: [Linuxptp-devel] [PATCHv3 2/8] rtnl: Add function to detect virtual clocks.

2022-05-16 Thread Vladimir Oltean
On Mon, May 16, 2022 at 09:30:22AM -0700, Richard Cochran wrote: > On Mon, May 16, 2022 at 06:19:01PM +0300, Vladimir Oltean wrote: > > > What I usually do when I need to determine whether a feature is > > available is to compile a dummy C program using the same CFLAGS as th

Re: [Linuxptp-devel] [PATCH v5 05/13] ts2phc: create a private data structure

2022-05-16 Thread Vladimir Oltean
On Sun, May 15, 2022 at 01:24:13PM -0700, Richard Cochran wrote: > On Tue, Nov 23, 2021 at 02:14:13AM +0200, Vladimir Oltean wrote: > > > diff --git a/ts2phc.h b/ts2phc.h > > new file mode 100644 > > index ..14cb2b0c21a3 > > --- /dev/null > &

Re: [Linuxptp-devel] [PATCHv3 2/8] rtnl: Add function to detect virtual clocks.

2022-05-16 Thread Vladimir Oltean
On Tue, Mar 08, 2022 at 11:46:59AM +0100, Miroslav Lichvar wrote: > Add a function using ethtool netlink to check whether a PHC is a virtual > clock of an interface. > > Signed-off-by: Miroslav Lichvar > Acked-by: Hangbin Liu > --- > incdefs.sh | 4 +++ > missing.h | 101

Re: [Linuxptp-devel] [PATCH v5 00/13] Dynamic sync direction for ts2phc

2022-03-07 Thread Vladimir Oltean
Hello Richard, On Tue, Nov 23, 2021 at 02:14:08AM +0200, Vladimir Oltean wrote: > As discussed in this email thread: > https://sourceforge.net/p/linuxptp/mailman/message/37047555/ > there is a desire to synchronize multiple DSA switches in a > boundary_clock_jbod setup, using

[Linuxptp-devel] [PATCH v3 1/2] util: fix dangling file descriptors on the error path of posix_clock_open

2021-11-24 Thread Vladimir Oltean
Fixes: 380d023abb1f ("posix_clock_open: derive PHC index from device name if possible") Signed-off-by: Vladimir Oltean --- v1->v2: patch is new v2->v3: reverse patch order util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util.c b/util.c index cc4f11008b

[Linuxptp-devel] [PATCH v3 2/2] util: attempt to resolve symlinks to the PHC device in posix_clock_open

2021-11-24 Thread Vladimir Oltean
problem, we maintain that the PTP clock char device must contain a number, if its path begins with /dev/ptp. But this time, we follow any symbolic links that might exist, before attempting to deduce the number from the path string. Fixes: 380d023abb1f ("posix_clock_open: derive PHC index fr

[Linuxptp-devel] [PATCH 1/2] util: attempt to resolve symlinks to the PHC device in posix_clock_open

2021-11-22 Thread Vladimir Oltean
problem, we maintain that the PTP clock char device must contain a number, if its path begins with /dev/ptp. But this time, we follow any symbolic links that might exist, before attempting to deduce the number from the path string. Fixes: 380d023abb1f ("posix_clock_open: derive PH

[Linuxptp-devel] [PATCH 2/2] util: fix dangling file descriptors on the error path of posix_clock_open

2021-11-22 Thread Vladimir Oltean
Fixes: 380d023abb1f ("posix_clock_open: derive PHC index from device name if possible") Signed-off-by: Vladimir Oltean --- util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util.c b/util.c index 686ed5e2f110..34b0bc8e109c 100644 --- a/util.c +++ b/util.c

[Linuxptp-devel] [PATCH v5 04/13] ts2phc: rename "master" to "source"

2021-11-22 Thread Vladimir Oltean
h describes the role of the data structure in the new interpretation of the program in a much clearer way. Signed-off-by: Vladimir Oltean --- v4->v5: patch is new ts2phc.c| 56 +- ts2phc_generic_pps_source.c | 32 +- ts2phc_gen

[Linuxptp-devel] [PATCH v5 07/13] ts2phc: instantiate a full clock structure for every PPS source of the PHC kind

2021-11-22 Thread Vladimir Oltean
rt states, which in "automatic" mode are dynamic, as the name suggests). Signed-off-by: Vladimir Oltean --- ts2phc.c| 2 +- ts2phc.h| 1 + ts2phc_generic_pps_source.c | 2 +- ts2phc_generic_pps_source.h | 3 ++- ts2phc_nmea_pps_source.c| 6

[Linuxptp-devel] [PATCH v5 02/13] ts2phc: rename source code files ("master" to "source", "slave" to "sink")

2021-11-22 Thread Vladimir Oltean
the time reference still coincides with the "PPS source", and the target clocks for synchronization still coincide with the "PPS sinks". The change only renames files and their occurrences in the source code (include paths and makefile). No functional change intended.

[Linuxptp-devel] [PATCH v5 11/13] ts2phc: reconfigure sync direction by subscribing to ptp4l port events

2021-11-22 Thread Vladimir Oltean
timestamp of the reference clock. All timestamps are representative of the same event, which is the most recent perout pulse of the PPS source. Signed-off-by: Vladimir Oltean --- v4->v5: - Rename source clock to reference clock, destination clock to target clock - Rebase on top of earlier data struc

[Linuxptp-devel] [PATCH v5 03/13] ts2phc: rename "slave clocks" to "PPS sinks"

2021-11-22 Thread Vladimir Oltean
h describes the role of the data structure in the new interpretation of the program in a much clearer way. Signed-off-by: Vladimir Oltean --- v4->v5: patch is new ts2phc.c | 24 ++--- ts2phc_pps_sink.c | 255 +++--- ts2phc_pps_sink.h | 12 +-

[Linuxptp-devel] [PATCH v5 05/13] ts2phc: create a private data structure

2021-11-22 Thread Vladimir Oltean
of being synchronized. So instead of having the translation modules of ts2phc communicate through global variables, let's make struct ts2phc_private the common working space for the entire program, which is a paradigm that is more natural. Signed-off-by: Vladimir Oltean Reviewed-by: Jacob Keller

[Linuxptp-devel] [PATCH v5 06/13] ts2phc: instantiate a full clock structure for every PPS sink

2021-11-22 Thread Vladimir Oltean
ck", and things that can timestamp external events should be represented by a "struct ts2phc_pps_sink". Signed-off-by: Vladimir Oltean --- v4->v5: - Rebased on top of data structure renames v3->v4: - rebased, needed to pass priv->cfg in ts2phc_nmea_master_create - setti

[Linuxptp-devel] [PATCH v5 09/13] ts2phc_slave: print offset to the source clock

2021-11-22 Thread Vladimir Oltean
Make this information more visible by default, since it is the key output of this program. Signed-off-by: Vladimir Oltean Reviewed-by: Jacob Keller --- v4->v5: rebase on top of the variable renames v1->v4: none ts2phc_pps_sink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[Linuxptp-devel] [PATCH v5 00/13] Dynamic sync direction for ts2phc

2021-11-22 Thread Vladimir Oltean
ded Jacob's review tags, addressed some feedback. - Dropped patch "pmc_common: fix potential memory leak in run_pmc_events()" - Reordered patches (put the tmv helpers first) - Fixed memory leaks Vladimir Oltean (13): pmc_agent: make pmc_agent_query_port_properties take an enum po

[Linuxptp-devel] [PATCH v5 10/13] ts2phc: split PPS sink poll from servo loop

2021-11-22 Thread Vladimir Oltean
source as well (the PHC kind). Signed-off-by: Vladimir Oltean --- v4->v5: - Rebase on top of the variable renaming. v3->v4: - Use bool for boolean types. v2->v3: - None. ts2phc.c | 94 +- ts2phc.h | 3 + ts2phc_pps_sin

[Linuxptp-devel] [PATCH v5 12/13] ts2phc: allow PHC PPS sources to be synchronized

2021-11-22 Thread Vladimir Oltean
source's PHC time, and round that to what is the most plausible integer second in its time base. We believe that to be the 'timestamp'. This is fed into the servo algorithm. The PHC PPS source can be synchronized to the extts events of a PHC slave, when in automatic mode. Signed-off-by: Vladimir Oltean

[Linuxptp-devel] [PATCH v5 08/13] ts2phc: instantiate a pmc agent

2021-11-22 Thread Vladimir Oltean
e, and the other PHC devices turn into target clocks. Signed-off-by: Vladimir Oltean --- v4->v5: - rebased on top of the variable renaming v3->v4: - use the new pmc agent API - add more info to the commit message - priv->state_changed can be delayed to a future patch - use enum port_state i

[Linuxptp-devel] [PATCH v5 13/13] ts2phc_phc_pps_source: make use of new kernel API for perout waveform

2021-11-22 Thread Vladimir Oltean
approximation of the precise perout timestamp. We put that code into a common function and convert all call sites to call that. We also need to do the same thing for the edge ignoring logic. Signed-off-by: Vladimir Oltean --- v4->v5: rebase on top of variable renames v3->v4: patch is new. co

[Linuxptp-devel] [PATCH v5 01/13] pmc_agent: make pmc_agent_query_port_properties take an enum port_state argument

2021-11-22 Thread Vladimir Oltean
Enforce type correctness and make all callers of pmc_agent_query_port_properties pass an enum port_state argument instead of plain int. Signed-off-by: Vladimir Oltean --- v4->v5: patch is new phc2sys.c | 6 -- pmc_agent.c | 2 +- pmc_agent.h | 3 ++- 3 files changed, 7 insertions(+)

Re: [Linuxptp-devel] [PATCH] Include phcIndex in PORT_PROPERTIES_NP PMC command

2021-11-19 Thread Vladimir Oltean
On Fri, Nov 19, 2021 at 05:22:16AM +, Karthikkumar Valoor wrote: > On Tue, 16 Nov 2021 at 15:22, Vladimir Oltean > mailto:olte...@gmail.com>> wrote: > On Tue, Nov 16, 2021 at 12:47:09PM +, Karthikkumar V via Linuxptp-devel > wrote: > > PORT_PROPERTIES_NP PMC

Re: [Linuxptp-devel] [PATCH] Include phcIndex in PORT_PROPERTIES_NP PMC command

2021-11-16 Thread Vladimir Oltean
On Tue, Nov 16, 2021 at 12:47:09PM +, Karthikkumar V via Linuxptp-devel wrote: > PORT_PROPERTIES_NP PMC Command will now display the phcIndex along with > other interface details. A typical use case will be Users can fetch the > phcIndex to use the clock APIs of the kernel (clock_gettime and

Re: [Linuxptp-devel] [PATCH v4 0/9] Dynamic sync direction for ts2phc

2021-11-15 Thread Vladimir Oltean
On Mon, Nov 15, 2021 at 06:15:08AM -0800, Richard Cochran wrote: > On Sat, Oct 09, 2021 at 05:11:51PM +0300, Vladimir Oltean wrote: > > > The overall board design for my use case is that there's an SoC with an > > embedded DSA switch, and hanging off of 3 ports of that embedde

Re: [Linuxptp-devel] [PATCH v4 2/9] ts2phc: instantiate a full clock structure for every slave PHC

2021-11-15 Thread Vladimir Oltean
On Mon, Nov 15, 2021 at 06:06:48AM -0800, Richard Cochran wrote: > On Sat, Oct 09, 2021 at 05:11:53PM +0300, Vladimir Oltean wrote: > > > diff --git a/ts2phc.c b/ts2phc.c > > index 67df5a532559..ca7684b314a4 100644 > > --- a/ts2phc.c > > +++ b/ts2phc.c > >

[Linuxptp-devel] [PATCH] util: don't error out in posix_clock_open() if we can't determine PHC index

2021-11-12 Thread Vladimir Oltean
ion which was introduces for that program, too. Fixes: 380d023abb1f ("posix_clock_open: derive PHC index from device name if possible") Reported-by: Ed Branch Signed-off-by: Vladimir Oltean --- Sorry for sending the email twice, last time the patch didn't make it to the list, I go

Re: [Linuxptp-devel] [RFC PATCH 00/10] checksync: new program to wait for a local or remote clock to synchronize

2021-11-04 Thread Vladimir Oltean
Hi Erez, Please use a decent mail client, and do something about your company man-in-the-middling the links. https://github.com/adbrucker/unsanitize-safelinks On Thu, Nov 04, 2021 at 02:33:46PM +, Geva, Erez wrote: > Nice, > > Your code is GPL, > > So using your code does not helps, we can

Re: [Linuxptp-devel] [RFC PATCH 00/10] checksync: new program to wait for a local or remote clock to synchronize

2021-11-04 Thread Vladimir Oltean
On Tue, Nov 02, 2021 at 01:34:01AM +0200, Vladimir Oltean wrote: > On Mon, Nov 01, 2021 at 03:56:38AM -0700, Richard Cochran wrote: > > On Mon, Nov 01, 2021 at 11:19:15AM +0200, Vladimir Oltean wrote: > > > > > For what it's worth, I have solved both my probl

Re: [Linuxptp-devel] [RFC PATCH 00/10] checksync: new program to wait for a local or remote clock to synchronize

2021-11-01 Thread Vladimir Oltean
On Mon, Nov 01, 2021 at 03:56:38AM -0700, Richard Cochran wrote: > On Mon, Nov 01, 2021 at 11:19:15AM +0200, Vladimir Oltean wrote: > > > For what it's worth, I have solved both my problems (checking ptp4l sync > > and phc2sys sync) through alternative methods, &

Re: [Linuxptp-devel] [RFC PATCH 00/10] checksync: new program to wait for a local or remote clock to synchronize

2021-11-01 Thread Vladimir Oltean
Hi Miroslav, On Mon, Nov 01, 2021 at 10:13:36AM +0100, Miroslav Lichvar wrote: > On Fri, Oct 29, 2021 at 03:35:30PM +0300, Vladimir Oltean wrote: > > If I look at the struct timex definition from "man adjtimex", I see that > > both maxerror and esterror are expre

Re: [Linuxptp-devel] [RFC PATCH 00/10] checksync: new program to wait for a local or remote clock to synchronize

2021-10-29 Thread Vladimir Oltean
On Thu, Oct 14, 2021 at 09:44:21AM +0200, Miroslav Lichvar wrote: > On Wed, Oct 13, 2021 at 08:37:27PM +0300, Vladimir Oltean wrote: > > The other topic is how to actually wait for phc2sys to synchronize, > > since the program presented here only works with ptp4l (or at least &

Re: [Linuxptp-devel] [RFC PATCH 10/10] checksync: new program to wait for a local or remote clock to synchronize

2021-10-15 Thread Vladimir Oltean
On Fri, Oct 15, 2021 at 10:48:28PM +, Geva, Erez wrote: > Regarding the "ugly scripting" of pmc. > > I create the http://libpmc.sf.net/ just to work around this issue. > > The libpmc provides a library with pmc tool capabilities, and wrapper for > scripting as Python, Lua and Perl. Is there

Re: [Linuxptp-devel] [RFC PATCH 00/10] checksync: new program to wait for a local or remote clock to synchronize

2021-10-14 Thread Vladimir Oltean
On Thu, Oct 14, 2021 at 09:44:21AM +0200, Miroslav Lichvar wrote: > On Wed, Oct 13, 2021 at 08:37:27PM +0300, Vladimir Oltean wrote: > > The other topic is how to actually wait for phc2sys to synchronize, > > since the program presented here only works with ptp4l (or at least &

[Linuxptp-devel] [RFC PATCH 00/10] checksync: new program to wait for a local or remote clock to synchronize

2021-10-13 Thread Vladimir Oltean
ck, and I don't know right now if that is the best overall design or if we can do better. Vladimir Oltean (10): pmc_agent: allow subscribing to TIME_STATUS_NP events pmc_agent: allow instantiating over other transports than UDS pmc_agent: add a function to retrieve clock identity util: make c

[Linuxptp-devel] [RFC PATCH 03/10] pmc_agent: add a function to retrieve clock identity

2021-10-13 Thread Vladimir Oltean
-by: Vladimir Oltean --- pmc_agent.c | 10 ++ pmc_agent.h | 12 2 files changed, 22 insertions(+) diff --git a/pmc_agent.c b/pmc_agent.c index b617d12f5287..e1c513fe10da 100644 --- a/pmc_agent.c +++ b/pmc_agent.c @@ -293,6 +293,16 @@ int pmc_agent_get_number_ports(struct pmc_agent *node

[Linuxptp-devel] [RFC PATCH 06/10] pmc_agent: make pmc_agent_query_port_properties take an enum port_state argument

2021-10-13 Thread Vladimir Oltean
Enforce type correctness and make all callers of pmc_agent_query_port_properties pass an enum port_state argument instead of plain int. Signed-off-by: Vladimir Oltean --- phc2sys.c | 6 -- pmc_agent.c | 2 +- pmc_agent.h | 2 +- ts2phc.c| 3 ++- 4 files changed, 8 insertions(+), 5

[Linuxptp-devel] [RFC PATCH 07/10] config: make boundary_hops a config item

2021-10-13 Thread Vladimir Oltean
ith a default of 1 and a valid range from 0 to 25.. Signed-off-by: Vladimir Oltean --- config.c | 1 + 1 file changed, 1 insertion(+) diff --git a/config.c b/config.c index 6ee46b448adc..82cd6b1ce8bd 100644 --- a/config.c +++ b/config.c @@ -225,6 +225,7 @@ struct config_item config_t

[Linuxptp-devel] [RFC PATCH 10/10] checksync: new program to wait for a local or remote clock to synchronize

2021-10-13 Thread Vladimir Oltean
ote ports to check. So when "-i" is specified and that interface is a master port, we actually check the sync status of the remote ports attached to it. [ note, we actually only check the sync status of the first remote port, that was sufficient for the point-to-point u

[Linuxptp-devel] [RFC PATCH 04/10] util: make cid_eq comparisons take a const pointer

2021-10-13 Thread Vladimir Oltean
There is no reason why cid_eq takes a non-const argument, so make it const. Signed-off-by: Vladimir Oltean --- util.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util.h b/util.h index 739c8fda0548..5a22c4a79401 100644 --- a/util.h +++ b/util.h @@ -84,7 +84,8 @@ char

[Linuxptp-devel] [RFC PATCH 05/10] clock: optionally allow remote subscriptions

2021-10-13 Thread Vladimir Oltean
with care. Signed-off-by: Vladimir Oltean --- clock.c | 22 +++--- config.c | 1 + 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/clock.c b/clock.c index d1c85ec5a7b1..0689360db410 100644 --- a/clock.c +++ b/clock.c @@ -76,6 +76,7 @@ struct clock_subscriber

[Linuxptp-devel] [RFC PATCH 09/10] util: make pid2str and cid2str take const pointer arguments

2021-10-13 Thread Vladimir Oltean
These functions do not modify their argument, so make it const for correctness. Signed-off-by: Vladimir Oltean --- util.c | 8 util.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/util.c b/util.c index 113467d08b9f..cc4f11008be2 100644 --- a/util.c +++ b

[Linuxptp-devel] [RFC PATCH 02/10] pmc_agent: allow instantiating over other transports than UDS

2021-10-13 Thread Vladimir Oltean
callers of init_pmc_node() to specify UDS. Signed-off-by: Vladimir Oltean --- phc2sys.c | 4 ++-- pmc_agent.c | 6 -- pmc_agent.h | 4 +++- ts2phc.c| 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/phc2sys.c b/phc2sys.c index 1c02e2b605b0..c706a72f144a 100644

[Linuxptp-devel] [RFC PATCH 08/10] pmc_agent: print management error code values

2021-10-13 Thread Vladimir Oltean
It may be useful to see why a remote system has returned an error for a PMC command, so add some code to print the error code and the string interpretation of it. Signed-off-by: Vladimir Oltean --- pmc_agent.c | 34 ++ 1 file changed, 34 insertions(+) diff --git

[Linuxptp-devel] [RFC PATCH 01/10] pmc_agent: allow subscribing to TIME_STATUS_NP events

2021-10-13 Thread Vladimir Oltean
the pmc_agent_subscribe() API by adding two boolean arguments, one for subscribing to port events and the other to time status events. Convert all users to pass true to the first and false to the latter. Signed-off-by: Vladimir Oltean --- phc2sys.c | 2 +- pmc_agent.c | 14 -- pmc_agent.h | 10

[Linuxptp-devel] [PATCH v4 5/9] ts2phc_slave: print master offset

2021-10-09 Thread Vladimir Oltean
Make this information more visible by default, since it is the key output of this program. Signed-off-by: Vladimir Oltean Reviewed-by: Jacob Keller --- Changes in v4: None. Changes in v3: None. ts2phc_slave.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[Linuxptp-devel] [PATCH v4 2/9] ts2phc: instantiate a full clock structure for every slave PHC

2021-10-09 Thread Vladimir Oltean
e prepared to handle this by recognizing that things that can be disciplined by a servo should be represented by a "struct clock", and things that can timestamp external events should be represented by a "struct ts2phc_slave". Signed-off-by: Vladimir Oltean --- Changes in v4: - r

[Linuxptp-devel] [PATCH v4 0/9] Dynamic sync direction for ts2phc

2021-10-09 Thread Vladimir Oltean
ot;pmc_common: fix potential memory leak in run_pmc_events()" - Reordered patches (put the tmv helpers first) - Fixed memory leaks Vladimir Oltean (9): ts2phc: create a private data structure ts2phc: instantiate a full clock structure for every slave PHC ts2phc: instantiate a full clock

[Linuxptp-devel] [PATCH v4 9/9] ts2phc_phc_master: make use of new kernel API for perout waveform

2021-10-09 Thread Vladimir Oltean
of the precise perout timestamp. We put that code into a common function and convert all call sites to call that. We also need to do the same thing for the edge ignoring logic. Signed-off-by: Vladimir Oltean --- Changes in v4: Patch is new. config.c| 1 + missing.h | 52

[Linuxptp-devel] [PATCH v4 3/9] ts2phc: instantiate a full clock structure for every PHC master

2021-10-09 Thread Vladimir Oltean
tes, which in "automatic" mode are dynamic, as the name suggests). Signed-off-by: Vladimir Oltean --- Changes in v4: - rebased, needed to pass priv->cfg in ts2phc_nmea_master_create - setting clock->is_destination can be delayed to a future patch Changes in v3: Non

[Linuxptp-devel] [PATCH v4 8/9] ts2phc: allow the PHC PPS master to be synchronized

2021-10-09 Thread Vladimir Oltean
time, and round that to what is the most plausible integer second in its time base. We believe that to be the 'timestamp'. This is fed into the servo algorithm. The PHC master can be synchronized to the extts events of a PHC slave, when in automatic mode. Signed-off-by: Vladimir Oltean --- Changes

[Linuxptp-devel] [PATCH v4 4/9] ts2phc: instantiate a pmc agent

2021-10-09 Thread Vladimir Oltean
e, and the other PHC devices turn into sinks. Signed-off-by: Vladimir Oltean --- Changes in v4: - use the new pmc agent API - add more info to the commit message - priv->state_changed can be delayed to a future patch - use enum port_state instead of int Changes in v3: - Added man page and usage v

[Linuxptp-devel] [PATCH v4 6/9] ts2phc: split slave poll from servo loop

2021-10-09 Thread Vladimir Oltean
it to be used by a ts2phc master as well (the PHC kind). Signed-off-by: Vladimir Oltean --- Changes in v4: Use bool for boolean types. Changes in v3: None. ts2phc.c | 94 ++- ts2phc.h | 3 + ts2phc_slave.c | 201 +++-- 3 files

[Linuxptp-devel] [PATCH v4 7/9] ts2phc: reconfigure sync direction by subscribing to ptp4l port events

2021-10-09 Thread Vladimir Oltean
the source clock. All timestamps are representative of the same event, which is the most recent perout pulse of the ts2phc master. Signed-off-by: Vladimir Oltean --- Changes in v4: Use bool for boolean types. Changes in v3: None. ts2phc.c

[Linuxptp-devel] [PATCH v4 1/9] ts2phc: create a private data structure

2021-10-09 Thread Vladimir Oltean
instead of having the translation modules of ts2phc communicate through global variables, let's make struct ts2phc_private the common working space for the entire program, which is a paradigm that is more natural. Signed-off-by: Vladimir Oltean Reviewed-by: Jacob Keller --- Changes in v4: - Rebased

Re: [Linuxptp-devel] [PATCH 2/2] phc2sys: fix BC sync fault when port in uncalibrated state

2020-12-24 Thread Vladimir Oltean
On Thu, Dec 24, 2020 at 06:36:19PM +0200, Grygorii Strashko wrote: > The ptp4l/phc2sys BC can stuck in sync fault while port is in transitional > UNCALIBRATED state: > MASTER -> UNCALIBRATED > UNCALIBRATED -> SLAVE > in the later case state change sequence is > UNCALIBRATED -> SLAVE ->

Re: [Linuxptp-devel] [PATCH 0/2] phc2sys: fix BC sync fault during port master->uncalibrated transition

2020-12-24 Thread Vladimir Oltean
Hi Grygorii, On Thu, Dec 24, 2020 at 06:36:17PM +0200, Grygorii Strashko wrote: > Hi > > I've found that it's pretty easy to put ptp4l/phc2sys BC in sync fault state > while port is in transitional UNCALIBRATED state: > MASTER -> UNCALIBRATED > UNCALIBRATED -> SLAVE > in the later case state

Re: [Linuxptp-devel] [PATCH] tc: introduce 1-step for E2E & P2P Transparent Clocks

2020-12-03 Thread Vladimir Oltean
On Thu, Dec 03, 2020 at 05:26:10PM -0800, Richard Cochran wrote: > On Fri, Dec 04, 2020 at 03:02:58AM +0200, Vladimir Oltean wrote: > > On Thu, Dec 03, 2020 at 04:34:46PM -0800, Richard Cochran wrote: > > > > Actually, for dpaa2, the one-step timestampin

Re: [Linuxptp-devel] [PATCH] tc: introduce 1-step for E2E & P2P Transparent Clocks

2020-12-03 Thread Vladimir Oltean
On Thu, Dec 03, 2020 at 04:34:46PM -0800, Richard Cochran wrote: > > Actually, for dpaa2, the one-step timestamping procedure just does: > > > > correctionField += t_TX - t_passed_inband > > > > where the driver populates: > > t_passed_inband = originTimestamp = approximate PTP time of software

Re: [Linuxptp-devel] [PATCH] tc: introduce 1-step for E2E & P2P Transparent Clocks

2020-12-03 Thread Vladimir Oltean
On Thu, Dec 03, 2020 at 05:35:09PM +0100, Volodymyr Bendiuga wrote: > Hi Vladimir, > > > How? The egress port has no idea what t1 was. Where is t1 recorded? > > The hardware we use, Marvell Alaska 88e1548P phy, has a couple of > possible solutions to our given problem, that is to say, updating the

Re: [Linuxptp-devel] [PATCH] tc: introduce 1-step for E2E & P2P Transparent Clocks

2020-12-03 Thread Vladimir Oltean
On Thu, Dec 03, 2020 at 05:52:24AM -0800, Richard Cochran wrote: > On Thu, Dec 03, 2020 at 01:22:35AM +0200, Vladimir Oltean wrote: > > > So now I will speculate a bit, and assume that the hardware behavior you > > need is for the port 1 to subtract the t1 RX timestamp from the

Re: [Linuxptp-devel] [PATCH] tc: introduce 1-step for E2E & P2P Transparent Clocks

2020-12-02 Thread Vladimir Oltean
Hi Volodymyr, On Wed, Dec 02, 2020 at 05:31:37PM +0100, Volodymyr Bendiuga wrote: > Hi Vladimir, and thank you for extra-well formulated question. > > Actually, when I was drafting an answer to your question, I realized I > had missed one very important point in the patch, namely, that SYNC >

Re: [Linuxptp-devel] [PATCH] tc: introduce 1-step for E2E & P2P Transparent Clocks

2020-12-01 Thread Vladimir Oltean
Hi Volodymyr, On Tue, Dec 01, 2020 at 05:14:38PM +0100, Volodymyr Bendiuga wrote: > From: Volodymyr Bendiuga > > This tiny patch provides generic solution for 1-step > E2E & P2P Transparent Clocks. > > Before revealing any further details, I want to state > in plain words that changes brought

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:

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

2020-11-28 Thread Vladimir Oltean
inally the time stamp in question > came from a PHC. ] > > Signed-off-by: Richard Cochran > --- Reviewed-by: Vladimir Oltean ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

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 > --- R

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

2020-11-28 Thread Vladimir Oltean
Richard Cochran > Reviewed-by: Jacob Keller > --- Reviewed-by: Vladimir Oltean ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

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

2020-11-28 Thread Vladimir Oltean
r whether > or not the caller subscribed to the notifications in the first place. > > Signed-off-by: Richard Cochran > --- Reviewed-by: Vladimir Oltean ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourcefor

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

2020-11-14 Thread Vladimir Oltean
On Tue, Nov 10, 2020 at 02:21:42PM -0800, Richard Cochran wrote: > This patch renames the function to have the module prefix and tries to > put into words what it does. Try, well said. > > Signed-off-by: Richard Cochran > --- > diff --git a/pmc_agent.c b/pmc_agent.c > index 528d4ee..94ef9ca

Re: [Linuxptp-devel] [PATCH 6/7] pmc_agent: Simplify update method yet again.

2020-11-14 Thread Vladimir Oltean
On Tue, Nov 10, 2020 at 02:21:41PM -0800, Richard Cochran wrote: > Reduce the expression !(x < y) to (x >= y). > > While we're at it, clean the coding style as well. > > Signed-off-by: Richard Cochran > --- > pmc_agent.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff

Re: [Linuxptp-devel] [PATCH 5/7] pmc_agent: Simplify logic in update method even more.

2020-11-14 Thread Vladimir Oltean
On Tue, Nov 10, 2020 at 02:21:40PM -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 4/7] pmc_agent: Simplify logic in update method.

2020-11-14 Thread Vladimir Oltean
On Tue, Nov 10, 2020 at 02:21:39PM -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 3/7] pmc_agent: Simplify the update method.

2020-11-14 Thread Vladimir Oltean
On Tue, Nov 10, 2020 at 02:21:38PM -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

Re: [Linuxptp-devel] [PATCH 2/7] pmc_agent: Convert the subscribe method into the canonical form.

2020-11-14 Thread Vladimir Oltean
On Tue, Nov 10, 2020 at 02:21:37PM -0800, Richard Cochran wrote: > This patch renames the function to have the module prefix and corrects the > return code semantics. > > Signed-off-by: Richard Cochran > --- Reviewed-by: Vladimir Oltean _

Re: [Linuxptp-devel] [PATCH 1/7] Introduce error codes for the run_pmc method.

2020-11-14 Thread Vladimir Oltean
tion used > throughout the stack. > > In order to migrate to proper return codes, this patch replaces the hard > coded result values with macros so that the interface methods can translate > them to the required semantics of zero on success. > > Signed-off-by: Richard Cochran >

Re: [Linuxptp-devel] [PATCH 5/5] Find a better home for the management TLV data helper function.

2020-11-09 Thread Vladimir Oltean
On Tue, Nov 10, 2020 at 01:28:19AM +0200, Vladimir Oltean wrote: > Again, great improvement already, but could you please say > 'Obtain the dataField from the Management TLV in a management message' > in the comments here? Some of us are not great with pattern matching, > and like to

Re: [Linuxptp-devel] [PATCH 5/5] Find a better home for the management TLV data helper function.

2020-11-09 Thread Vladimir Oltean
On Mon, Nov 09, 2020 at 01:44:59PM -0800, Richard Cochran wrote: > Signed-off-by: Richard Cochran > --- > msg.h | 12 > phc2sys.c | 2 +- > pmc_agent.c | 18 +- > pmc_agent.h | 1 - > 4 files changed, 18 insertions(+), 15 deletions(-) > > diff --git

Re: [Linuxptp-devel] [PATCH 4/5] Find a better home for the management TLV ID helper function.

2020-11-09 Thread Vladimir Oltean
On Mon, Nov 09, 2020 at 01:44:58PM -0800, Richard Cochran wrote: > Signed-off-by: Richard Cochran > --- > msg.h | 12 > phc2sys.c | 2 +- > pmc_agent.c | 10 +- > pmc_agent.h | 1 - > 4 files changed, 14 insertions(+), 11 deletions(-) > > diff --git a/msg.h

Re: [Linuxptp-devel] [PATCH 3/5] pmc_agent: Hide the implementation.

2020-11-09 Thread Vladimir Oltean
On Mon, Nov 09, 2020 at 01:44:57PM -0800, Richard Cochran wrote: > The PMC agent's implementation should not be exposed to its users. This > patch hides the details and provides a method to create an instance. In > addition, the signature of the receive callback is made generic, removing > the

Re: [Linuxptp-devel] [PATCH 2/5] pmc_agent: Rename pmc_node to something more descriptive.

2020-11-09 Thread Vladimir Oltean
On Mon, Nov 09, 2020 at 01:44:56PM -0800, Richard Cochran wrote: > Signed-off-by: Richard Cochran > --- > phc2sys.c | 4 ++-- > pmc_agent.c | 26 +- > pmc_agent.h | 26 +- > 3 files changed, 28 insertions(+), 28 deletions(-) > > diff --git

Re: [Linuxptp-devel] [PATCH v3 04/12] phc2sys: break out pmc code into pmc_common.c

2020-11-08 Thread Vladimir Oltean
On Sun, Nov 08, 2020 at 08:59:46PM +0200, Vladimir Oltean wrote: > Well, I'll probably need to resend anyway, I just noticed that patch > "ts2phc: instantiate a full clock structure for every PHC master" > doesn't build. I'm not sure how that passed my QC. So just let me know &

  1   2   3   >