Re: [Linuxptp-devel] [Linuxptp-users] How do I implement Sync message receive timeout according to Automotive and 802.1 AS profiles?

2020-02-11 Thread Michael Walle
Hi all, Am 2019-09-26 16:53, schrieb Erik Hons: Hi Yangbo, > > May I have your suggestion here? To maintain gPTP time in software, > > I just copied kernel timecounter code into linuxptp for usage. > > Why? That sounds wrong. Regarding to physical clock adjustment, that's confusing. This

[Linuxptp-devel] [PATCH RFC 19/30] Convert call sites to the proper method for getting the PHC index.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- clock.c | 2 +- port.c | 17 ++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/clock.c b/clock.c index 5001e66..71b3899 100644 --- a/clock.c +++ b/clock.c @@ -976,7 +976,7 @@ struct clock *clock_create(enum clock_type type,

[Linuxptp-devel] [PATCH RFC 29/30] interface: Silence warning from gcc version 8.

2020-02-11 Thread Richard Cochran
When compiling with gcc8 and -O2, the clever compiler complains: interface.c: In function ‘interface_ensure_tslabel’: interface.c:38:3: error: ‘strncpy’ output may be truncated copying 108 bytes from a string of length 108 [-Werror=stringop-truncation] Even though this is a false

[Linuxptp-devel] [PATCH RFC 00/30] Convert open coded interface into proper module.

2020-02-11 Thread Richard Cochran
Using gcc8 and -O2, the compiler emits an annoying false positive warning. Since I want to have -Werror, I went about fixing it. Start pulling on a thread, and ... The 'struct interface' is wide open to its users, and each user fiddles with the fields in a different way. The cure is, of

[Linuxptp-devel] [PATCH RFC 04/30] utils: Constify the posix clock interface.

2020-02-11 Thread Richard Cochran
The function to open a posix clock never modifies the passed in string. This patch adds the const keyword to ensure this function stays that way. Signed-off-by: Richard Cochran --- util.c | 2 +- util.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/util.c b/util.c

[Linuxptp-devel] [PATCH RFC 21/30] Convert call sites to the proper method for testing time stamp info validity.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- clock.c | 4 ++-- port.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/clock.c b/clock.c index 71b3899..845e27a 100644 --- a/clock.c +++ b/clock.c @@ -956,7 +956,7 @@ struct clock *clock_create(enum clock_type type, struct config

[Linuxptp-devel] [PATCH RFC 23/30] Convert call sites to the proper method for testing time stamping modes.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- clock.c | 2 +- port.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/clock.c b/clock.c index 845e27a..71b5795 100644 --- a/clock.c +++ b/clock.c @@ -957,7 +957,7 @@ struct clock *clock_create(enum clock_type type, struct config

[Linuxptp-devel] [PATCH RFC 27/30] pmc: Use the proper create/destroy API for network interfaces.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- pmc_common.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pmc_common.c b/pmc_common.c index 41181fb..3aab4b9 100644 --- a/pmc_common.c +++ b/pmc_common.c @@ -313,6 +313,7 @@ struct pmc { struct PortIdentity

[Linuxptp-devel] [PATCH RFC 26/30] config: Use the proper create/destroy API for network interfaces.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- config.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/config.c b/config.c index 717ee65..e033842 100644 --- a/config.c +++ b/config.c @@ -829,13 +829,11 @@ struct interface *config_create_interface(const char *name, struct config

[Linuxptp-devel] [PATCH RFC 18/30] interface: Introduce a method to get the PHC index.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- interface.c | 5 + interface.h | 7 +++ 2 files changed, 12 insertions(+) diff --git a/interface.c b/interface.c index d7eeb41..02f63a0 100644 --- a/interface.c +++ b/interface.c @@ -28,6 +28,11 @@ const char *interface_name(struct interface *iface)

[Linuxptp-devel] [PATCH RFC 12/30] interface: Introduce a method to initialize the time stamping label.

2020-02-11 Thread Richard Cochran
In many cases, the time stamping label will be the same as the name of the interface. In order to prevent users from open coding the logic that initializes the label from the interface name, this patch add an appropriate method. Signed-off-by: Richard Cochran --- interface.c | 7 +++

[Linuxptp-devel] [PATCH RFC 15/30] Convert call sites to the proper method for setting the name.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- clock.c | 5 +++-- config.c | 2 +- pmc_common.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/clock.c b/clock.c index 3895d09..159fcb2 100644 --- a/clock.c +++ b/clock.c @@ -850,6 +850,7 @@ struct clock *clock_create(enum

[Linuxptp-devel] [PATCH RFC 25/30] clock: Use the proper create/destroy API for network interfaces.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- clock.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/clock.c b/clock.c index 71b5795..e5f104e 100644 --- a/clock.c +++ b/clock.c @@ -122,7 +122,7 @@ struct clock { struct clock_stats stats; int

[Linuxptp-devel] [PATCH RFC 22/30] interface: Introduce a method to test supported time stamping modes.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- interface.c | 8 interface.h | 8 2 files changed, 16 insertions(+) diff --git a/interface.c b/interface.c index 7a3eddc..74a2512 100644 --- a/interface.c +++ b/interface.c @@ -47,3 +47,11 @@ bool interface_tsinfo_valid(struct interface

[Linuxptp-devel] [PATCH RFC 09/30] Convert call sites to the proper method for getting interface labels.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- clock.c | 2 +- port.c | 17 ++--- raw.c | 5 +++-- udp.c | 2 +- udp6.c | 2 +- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/clock.c b/clock.c index 7d13b3b..66c6bc1 100644 --- a/clock.c +++ b/clock.c @@ -962,7 +962,7

[Linuxptp-devel] [PATCH RFC 02/30] config: Constify the public interface.

2020-02-11 Thread Richard Cochran
The two methods, config_create_interface and config_read, never modify the strings passed in. This patch adds the const keyword to ensure these functions stay that way. Signed-off-by: Richard Cochran --- config.c | 4 ++-- config.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)

[Linuxptp-devel] [PATCH RFC 08/30] interface: Introduce an access method for the time stamping label.

2020-02-11 Thread Richard Cochran
Many of the users only require a read only reference to the time stamping label of the interface. This patch adds an appropriate method. Signed-off-by: Richard Cochran --- interface.c | 5 + interface.h | 9 + 2 files changed, 14 insertions(+) diff --git a/interface.c

[Linuxptp-devel] [PATCH RFC 17/30] Convert call sites to the proper method for setting the time stamping label.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- clock.c | 6 -- nsm.c | 5 - port.c | 2 +- rtnl.c | 2 +- rtnl.h | 4 +++- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/clock.c b/clock.c index 159fcb2..5001e66 100644 --- a/clock.c +++ b/clock.c @@ -846,6 +846,7 @@ struct clock

[Linuxptp-devel] [PATCH RFC 24/30] interface: Introduce methods to create and destroy instances.

2020-02-11 Thread Richard Cochran
In order to eventually hide the implementation details of the interface, users will need to be able to create and destroy instances thereof. This patch adds the needed methods. Signed-off-by: Richard Cochran --- interface.c | 19 +++ interface.h | 13 + 2 files

[Linuxptp-devel] [PATCH RFC 14/30] interface: Introduce a method to set the name.

2020-02-11 Thread Richard Cochran
The name field of the interface is set in different ways by different callers. In order to prevent users from open coding the logic that sets the name, this patch adds an appropriate method. Signed-off-by: Richard Cochran --- interface.c | 5 + interface.h | 8 +++- 2 files changed, 12

[Linuxptp-devel] [PATCH RFC 10/30] interface: Introduce a method to get the time stamping information.

2020-02-11 Thread Richard Cochran
In order to prevent users from open coding this logic, this patch provides a method that populates the time stamping information from the interface label. Signed-off-by: Richard Cochran --- interface.c | 5 + interface.h | 7 +++ 2 files changed, 12 insertions(+) diff --git

[Linuxptp-devel] [PATCH RFC 28/30] interface: Hide the implementation details.

2020-02-11 Thread Richard Cochran
Now that a complete functional API is in place, there is no need to expose the inner workings of the network interface data type. This patch converts it into an opaque type while leaving the list marker visible to users through a simple form of "friendly exposition". Signed-off-by: Richard

[Linuxptp-devel] [PATCH RFC 30/30] interface: Remove obsolete method.

2020-02-11 Thread Richard Cochran
Now that all call sites have been converted to interface_create(), there is no longer any needed for a way to set the interface's name. This patch removes the useless method. Signed-off-by: Richard Cochran --- interface.c | 7 +-- interface.h | 7 --- 2 files changed, 1 insertion(+),

[Linuxptp-devel] [PATCH RFC 20/30] interface: Introduce a method to test the time stamping information validity.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- interface.c | 5 + interface.h | 8 2 files changed, 13 insertions(+) diff --git a/interface.c b/interface.c index 02f63a0..7a3eddc 100644 --- a/interface.c +++ b/interface.c @@ -42,3 +42,8 @@ void interface_set_name(struct interface *iface, const

[Linuxptp-devel] [PATCH RFC 01/30] Group related objects together within the makefile.

2020-02-11 Thread Richard Cochran
Any program that links to the servo interface must also link with the implementations of that interface. Similarly, the filter and network transport interfaces each require their implementations. This patch re-factors the makefile to reflect this fact in order to simplify adding new programs

[Linuxptp-devel] [PATCH RFC 07/30] Convert call sites to the proper method for getting interface names.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- clock.c| 21 +++-- config.c | 12 +++- makefile | 10 +- nsm.c | 9 + pmc_common.c | 2 +- port.c | 19 +++ port_private.h | 2 +- udp.c | 2 +- udp6.c

[Linuxptp-devel] [PATCH RFC 13/30] Convert call sites to the proper method for initializing the time stamping label.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- clock.c | 12 +--- nsm.c| 4 +--- pmc_common.c | 4 +--- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/clock.c b/clock.c index f987965..3895d09 100644 --- a/clock.c +++ b/clock.c @@ -842,16 +842,6 @@ int

[Linuxptp-devel] [PATCH RFC 16/30] interface: Introduce a method to set the time stamping label.

2020-02-11 Thread Richard Cochran
The ts_label field of the interface is set in different ways by different callers. In order to prevent users from open coding the logic that sets the label, this patch adds an appropriate method. Signed-off-by: Richard Cochran --- interface.c | 5 + interface.h | 7 +++ 2 files

[Linuxptp-devel] [PATCH RFC 11/30] Convert call sites to the proper method for getting time stamp information.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- clock.c | 2 +- port.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/clock.c b/clock.c index 66c6bc1..f987965 100644 --- a/clock.c +++ b/clock.c @@ -962,7 +962,7 @@ struct clock *clock_create(enum clock_type type, struct config

[Linuxptp-devel] [PATCH RFC 06/30] interface: Introduce an access method for the name field.

2020-02-11 Thread Richard Cochran
Many of the users only require a read only reference to the interface name. This patch adds an appropriate method. Signed-off-by: Richard Cochran --- interface.c | 12 interface.h | 7 +++ makefile| 8 3 files changed, 23 insertions(+), 4 deletions(-) create

[Linuxptp-devel] [PATCH RFC 05/30] Move the network interface into its own header file.

2020-02-11 Thread Richard Cochran
Up until now, the users of the interface data structure simply access its fields without restriction. This patch takes the first step towards abstracting this data structure by giving it a file of its very own. Signed-off-by: Richard Cochran --- config.h| 15 +-- interface.h |

[Linuxptp-devel] [PATCH RFC 03/30] rtnl: Constify the public interface.

2020-02-11 Thread Richard Cochran
Three of the rtnl methods never modify the strings passed in. This patch adds the const keyword to ensure these functions stay that way. Signed-off-by: Richard Cochran --- rtnl.c | 6 +++--- rtnl.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rtnl.c b/rtnl.c index