Re: [Linuxptp-devel] Transport specific in UDP

2018-02-18 Thread Petr Kulhavy
Hi Richard, that sounds like a good solution. Are you going to include it in the mainstream? Regards Petr On 13/02/18 19:19, Richard Cochran wrote: On Tue, Feb 13, 2018 at 06:04:55PM +0100, Petr Kulhavy wrote: Let me develop this idea further. What about splitting the transportSpecific

Re: [Linuxptp-devel] Transport specific in UDP

2018-02-13 Thread Petr Kulhavy
Hi Richard, On 13/02/18 17:27, Richard Cochran wrote: On Tue, Feb 13, 2018 at 10:50:23AM +0100, brain wrote: Dante sends ts=8 and other manufacturers send ts=0. Unless Linuxptp properly implements the ts handling (i.e. ignoring bits 1-3) it cannot work in such networks. Simply because fix-conf

Re: [Linuxptp-devel] Transport specific in UDP

2018-02-12 Thread Petr Kulhavy
On 12/02/18 19:12, Richard Cochran wrote: On Mon, Feb 12, 2018 at 08:12:38AM +0100, brain wrote: I understand that you might find this requirement to be pointless. However in protocols it is not uncommon that certain bits are reserved for future use. In order to provide forward compatible implem

[Linuxptp-devel] [PATCH] port: match transport specific according to the transport type

2018-02-11 Thread Petr Kulhavy
Annex. Signed-off-by: Petr Kulhavy --- port.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/port.c b/port.c index d8e29d5..bdee1b4 100644 --- a/port.c +++ b/port.c @@ -631,6 +631,29 @@ static int port_clr_tmo(int fd) return timerfd_settime(fd

[Linuxptp-devel] Transport specific in UDP

2018-02-11 Thread Petr Kulhavy
Hi, It seems linuxptp does not comply to the IEEE1588-2008 standard when it comes to processing of the transport specific field in UDP transport. The Annex D.4 of the standard says "bit 1-3, reserved, The bit shall be transmitted as zero and ignored by the receiver". Linuxptp does not ignore

Re: [Linuxptp-devel] [PATCH] phc2sys: add transport specific

2018-01-29 Thread Petr Kulhavy
Hi Jake, as far as I can see, phc2sys doesn't have config support. Regards Petr On 29/01/18 19:43, Keller, Jacob E wrote: -Original Message- From: Petr Kulhavy [mailto:br...@jikos.cz] Sent: Monday, January 29, 2018 7:49 AM To: linuxptp-devel@lists.sourceforge.net Subject: [Lin

[Linuxptp-devel] [PATCH] phc2sys: add transport specific

2018-01-29 Thread Petr Kulhavy
Add option -T to specify transport specific field other than 0. Signed-off-by: Petr Kulhavy --- phc2sys.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/phc2sys.c b/phc2sys.c index 5c54055..dc5a71a 100644 --- a/phc2sys.c +++ b/phc2sys.c @@ -871,13 +871,13

[Linuxptp-devel] Transport specific for phc2sys

2018-01-29 Thread Petr Kulhavy
Hi, if ptp4l uses other transport specific number than 0, it seems phc2sys cannot be used to synchronize the system clock. Phc2sys passes constant 0 as transport specific to pmc_create(). This results to infinite "Waiting for ptp4l..." What about adding a config option to set the transport spe

[Linuxptp-devel] phc2sys freezes the system if started before PHY

2018-01-27 Thread Petr Kulhavy
Hi, I'm having an interesting problem with phc2sys. On my embedded iMX6 board phc2sys is started (together with ptp4l) via systemd during the system initialization. It is called with the following parameters: phc2sys -s /dev/ptp0 -c CLOCK_REALTIME -w -S 1.0 Until now it worked well, however a

Re: [Linuxptp-devel] phc2sys: Might be used uninitialized warning

2018-01-27 Thread Petr Kulhavy
I saw that. But the compiler has absolutely no way to know that. get_arg_val_i() is in another .c file. Regards Petr On 28/01/18 02:14, Richard Cochran wrote: On Sun, Jan 28, 2018 at 01:39:12AM +0100, Petr Kulhavy wrote: The compiler is right. If do_pps_loop() is called with node

[Linuxptp-devel] phc2sys: Might be used uninitialized warning

2018-01-27 Thread Petr Kulhavy
Hi, when compiling the latest head, I'm getting the following warning: phc2sys.c: In function ‘main’: phc2sys.c:653:11: warning: ‘phc_ts’ may be used uninitialized in this function [-Wmaybe-uninitialized]     phc_ts -= phc_offset;    ^ phc2sys.c:628:19: note: ‘phc_ts’ was declared her

[Linuxptp-devel] Leap seconds in Linux

2018-01-15 Thread Petr Kulhavy
Hi, my question is not directly related to linuxptp, but the expertise here might be the right one to answer it. Is there a way to retrieve a UT1 timestamp on Linux? It seems all the library functions like gettimeofday(), clock_gettime() etc. return the Unix time without leap seconds. And th

[Linuxptp-devel] Build commands

2017-07-01 Thread Petr Kulhavy
Hi, is there a specific reason why Linuxptp overrides the build commands to gcc and cpp (with the $(CROSS_COMPILE) prefix) instead of using the standard Make variables $(CC) and $(CPP)? Does it mean that Linuxptp works only with GCC? Thanks Petr -

Re: [Linuxptp-devel] [PATCH 0/1] Fix build when using uClinux.

2017-06-07 Thread Petr Kulhavy
I'm going to use that version to create a new patch for Buildroot. FYI there are still the "may be used uninitialised" warnings in phc2sys.c I mentioned earlier. See the logfile when running the BR test script. Regards Petr On 30/05/17 08:51, Richard Cochran wrote: On Tue, May 30, 2017 at 08

Re: [Linuxptp-devel] [PATCH 4/4] Improve detection of clock_nanosleep

2017-05-31 Thread Petr Kulhavy
Thanks, Richard. That's a good catch. I'm going to fix that. Regards Petrr On 30/05/17 08:00, Richard Cochran wrote: On Mon, May 15, 2017 at 11:37:05PM +0200, Petr Kulhavy wrote: I'm trying to get linuxptp into Buildroot so that it compiles on all 49 targets. FYI, your

Re: [Linuxptp-devel] [PATCH 4/4] Improve detection of clock_nanosleep

2017-05-23 Thread Petr Kulhavy
ichard Cochran wrote: > On Mon, May 22, 2017 at 11:05:39PM +0200, Petr Kulhavy wrote: >> I can't find any rational argument against test-compiling a piece of code in >> that negatively loaded emotional outburst you referred to. > you still have to do the hard work and figur

Re: [Linuxptp-devel] [PATCH 4/4] Improve detection of clock_nanosleep

2017-05-23 Thread Petr Kulhavy
That is misleading. Some earlier versions of uclibc completely lack clock_nanosleep(). Petr On 23/05/17 06:42, Richard Cochran wrote: > On Mon, May 22, 2017 at 11:05:39PM +0200, Petr Kulhavy wrote: >> If you don't like it, please take my email just as a bugreport: linuxptp >

Re: [Linuxptp-devel] [PATCH 4/4] Improve detection of clock_nanosleep

2017-05-22 Thread Petr Kulhavy
please take my email just as a bugreport: linuxptp fails to build with uclibc, details in my previous emails. I don't have the time and resources to investigate this deeper. Regards Petr On 22/05/17 06:51, Richard Cochran wrote: > On Mon, May 22, 2017 at 12:09:06AM +0200, Petr Kulhavy wrote

Re: [Linuxptp-devel] [PATCH] phc2sys: fix maybe uninitialized warnings

2017-05-22 Thread Petr Kulhavy
1, Richard Cochran wrote: > On Sun, May 21, 2017 at 10:32:10PM +0200, Petr Kulhavy wrote: >> Fix "may be used uninitialized in this function" warnings for state and >> timestamping. > Please tell us more: > > What gcc version produces this warning? > > Is th

Re: [Linuxptp-devel] [PATCH 4/4] Improve detection of clock_nanosleep

2017-05-21 Thread Petr Kulhavy
nt it. Currently linuxptp seems to rather fail with uclibc. Regards Petr On 21/05/17 21:10, Richard Cochran wrote: > On Mon, May 15, 2017 at 11:37:05PM +0200, Petr Kulhavy wrote: >> However it is too weak. On some targets clock_nanosleep is defined >> conditionally in #if preproc

[Linuxptp-devel] [PATCH] phc2sys: fix maybe uninitialized warnings

2017-05-21 Thread Petr Kulhavy
Fix "may be used uninitialized in this function" warnings for state and timestamping. Signed-off-by: Petr Kulhavy --- phc2sys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phc2sys.c b/phc2sys.c index 4c8b552..f3cfed8 100644 --- a/phc2sys.c +++ b/phc2sys.c

[Linuxptp-devel] [PATCH 2/2] Implement SET method for DOMAIN

2017-05-17 Thread Petr Kulhavy
This patch enables setting the domainNumber via the pmc command in runtime. Signed-off-by: Petr Kulhavy --- clock.c | 6 ++ pmc.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/clock.c b/clock.c index 629a160..a2a61a2 100644 --- a/clock.c +++ b/clock.c @@ -538,6

[Linuxptp-devel] [PATCH 1/2] pmc: optimize duplicated code in do_set_action()

2017-05-17 Thread Petr Kulhavy
TLV_PRIORITY1 and TLV_PRIORITY2 cases in do_set_action() use the same repeated piece of generic code for setting one-value parameter. Remove the duplicated code and let both cases use the same code. Signed-off-by: Petr Kulhavy --- pmc.c | 8 1 file changed, 8 deletions(-) diff --git a

Re: [Linuxptp-devel] [PATCH] clock: fix possible buffer overrun

2017-05-16 Thread Petr Kulhavy
tr On 16/05/17 22:18, Richard Cochran wrote: > On Tue, May 16, 2017 at 09:58:19PM +0200, Petr Kulhavy wrote: >> Did I miss something? What is the reason then? > Never mind, this is snprintf() and not strncpy(). > > The original code was confused and misleading using 31 (

Re: [Linuxptp-devel] [PATCH] clock: fix possible buffer overrun

2017-05-16 Thread Petr Kulhavy
Did I miss something? What is the reason then? Petr On 16/05/17 21:54, Richard Cochran wrote: > On Tue, May 16, 2017 at 04:56:48PM +0200, Petr Kulhavy wrote: >> This is not a fix of an actual issue rather than prevention of a potential >> issue. > No, your patch introduces an

[Linuxptp-devel] [PATCH] clock: fix possible buffer overrun

2017-05-16 Thread Petr Kulhavy
This is not a fix of an actual issue rather than prevention of a potential issue. On two places a fixed array size (different to the actual size) is used in snprintf. Replace with sizeof(array) Signed-off-by: Petr Kulhavy --- clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

Re: [Linuxptp-devel] [PATCH 4/4] Improve detection of clock_nanosleep

2017-05-15 Thread Petr Kulhavy
uxptp into Buildroot so that it compiles on all 49 targets. Regards Petr On 15/05/17 23:29, Richard Cochran wrote: > On Mon, May 15, 2017 at 10:17:54AM +0200, Petr Kulhavy wrote: >> On some platforms compilation issues due to clock_nanosleep were occuring. >> The >> simp

[Linuxptp-devel] [PATCH 4/4] Improve detection of clock_nanosleep

2017-05-15 Thread Petr Kulhavy
accordingly. For cross-compilation purposes CFLAGS in makefile is not set but += is used. Also the CC variable is passed to the incdefs.sh script. Signed-off-by: Petr Kulhavy --- incdefs.sh | 14 ++ makefile | 4 ++-- missing.h | 15 +-- 3 files changed, 25 insertions(+), 8

[Linuxptp-devel] [PATCH 3/4] Fix detection of clock_adjtime

2017-05-15 Thread Petr Kulhavy
On some platforms clock_adjtime is defined in timex.h instead of time.h Due to this fact the detection in incdefs.h was failing. Add timex.h into the list of searched files. Signed-off-by: Petr Kulhavy --- incdefs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/incdefs.sh

[Linuxptp-devel] [PATCH 1/4] Add missing time.h header

2017-05-15 Thread Petr Kulhavy
On some targets the time_t structure was missing and the compilation was failing. Signed-off-by: Petr Kulhavy --- util.h | 1 + 1 file changed, 1 insertion(+) diff --git a/util.h b/util.h index e912f19..3efde5c 100644 --- a/util.h +++ b/util.h @@ -22,6 +22,7 @@ #include "ddt.h"

[Linuxptp-devel] [PATCH 2/4] Remove conflicting netinet/ether.h

2017-05-15 Thread Petr Kulhavy
On some platforms like br-arm-cortex-a9-musl struct ethhdr was defined twice due to including of both linux/if_ether.h and netinet/ether.h. Which lead to a compilation error. Remove netinet/ether.h as the official header for struct ethhdr is linux/if_ether.h Signed-off-by: Petr Kulhavy