[Linuxptp-devel] [PATCH] sk: Use EUI-64 address for 6LoWPAN devices

2018-03-12 Thread Michael Brown
6LoWPAN devices have an EUI-64 address rather than an EUI-48 address. Use the full EUI-64 address when generating the clock identity to avoid duplicates. The constant ARPHRD_6LOWPAN is not yet present in the glibc version of if_arp.h, so define it locally if necessary. Signed-off-by: Michael

[Linuxptp-devel] [PATCH 2/7] port: Treat ingressLatency and egressLatency as corrections

2018-03-12 Thread Michael Brown
The function ts_add() currently performs open-coded manipulation of a struct timespec instead of using the tmv_t abstractions. Prepare for the removal of this code by storing ingressLatency and egressLatency as corrections (matching the behaviour for delayAsymmetry). Signed-off-by: Michael Brown

[Linuxptp-devel] [PATCH 0/7] Use tmv_t abstraction for hardware timestamps

2018-03-12 Thread Michael Brown
of code review. Patch 0001 temporarily introduces an overlength line, which is subsequently shortened in patch 0004. Michael Brown (7): clock: Remove open-coded conversion of struct timespec port: Treat ingressLatency and egressLatency as corrections port: Match calling convention

[Linuxptp-devel] [PATCH 3/7] port: Match calling convention for tmv_to_Timestamp()

2018-03-12 Thread Michael Brown
accepting a pointer to a struct Timestamp. Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- port.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/port.c b/port.c index 3791e59..76f8c91 100644 --- a/port.c +++ b/port.c @@ -393,11 +393,13 @@

[Linuxptp-devel] [PATCH 4/7] msg: Represent hw_timestamp "ts" field as tmv_t

2018-03-12 Thread Michael Brown
() instead of open-coded manipulation of a struct timespec and struct Timestamp in ts_to_Timestamp() - use tmv_is_zero() instead of open-coded manipulation of a struct timespec in msg_sots_valid() Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- msg.h | 4 ++-- nsm.c | 4 ++--

[Linuxptp-devel] [PATCH 1/7] clock: Remove open-coded conversion of struct timespec

2018-03-12 Thread Michael Brown
clockcheck_sample(). Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- clock.c | 6 ++ clock.h | 2 +- port.c | 3 ++- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/clock.c b/clock.c index 199c0cb..cf087e8 100644 --- a/clock.c +++ b/clock.c @@ -1767,11 +1767,9 @

[Linuxptp-devel] [PATCH v2] sk: Use EUI-64 address for 6LoWPAN devices

2018-03-12 Thread Michael Brown
-by: Michael Brown <mbr...@fensystems.co.uk> --- v2: Local definition of ARPHRD_6LOWPAN moved to missing.h as requested by Miroslav Lichvar missing.h | 5 + sk.c | 5 + 2 files changed, 10 insertions(+) diff --git a/missing.h b/missing.h index 16ae97a..d85c5ad

[Linuxptp-devel] [PATCH 08/13] tmv: Include fractional nanoseconds within internal representation

2018-02-28 Thread Michael Brown
Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- makefile | 2 +- tmv.c| 136 +++ tmv.h| 112 +--- 3 files changed, 156 insertions(+), 94 deletions(-) creat

[Linuxptp-devel] [PATCH 09/13] tmv: Add converters for hardware timestamps

2018-02-28 Thread Michael Brown
Add converters between hardware timestamps and the internal representation, and remove code that directly manipulates the timespec within a hardware timestamp. This is a prerequisite for the use of hardware timestamps with sub-nanosecond granularity. Signed-off-by: Michael Brown <

[Linuxptp-devel] [PATCH 00/13] Prepare for sub-nanosecond timestamps

2018-02-28 Thread Michael Brown
for your excellent work on linuxptp! Michael Brown (13): tmv: Add missing uses of tmv_zero() tmv: Add missing uses of tmv_is_zero() tmv: Add missing uses of tmv_dbl() tmv: Add missing uses of tmv_to_nanoseconds() tmv: Generalise tmv_eq() to tmv_cmp() tmv: Add tmv_sign() tmv: Convert tmv_t

[Linuxptp-devel] [PATCH 11/13] clock: Print statistics as floating point values

2018-02-28 Thread Michael Brown
Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- clock.c | 24 +++- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/clock.c b/clock.c index c887a11..d72efb2 100644 --- a/clock.c +++ b/clock.c @@ -545,15 +545,15 @@ static void clock_stats_update(

[Linuxptp-devel] [PATCH 03/13] tmv: Add missing uses of tmv_dbl()

2018-02-28 Thread Michael Brown
Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- tsproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsproc.c b/tsproc.c index 06c0184..b50c8e5 100644 --- a/tsproc.c +++ b/tsproc.c @@ -214,7 +214,7 @@ int tsproc_update_offset(struct tsproc *tsp, tmv_t *

[Linuxptp-devel] [PATCH 12/13] tsproc: Print statistics as floating point values

2018-02-28 Thread Michael Brown
Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- tsproc.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tsproc.c b/tsproc.c index a871049..0597f40 100644 --- a/tsproc.c +++ b/tsproc.c @@ -134,11 +134,10 @@ tmv_t get_raw_delay(struct tspro

[Linuxptp-devel] [PATCH 02/13] tmv: Add missing uses of tmv_is_zero()

2018-02-28 Thread Michael Brown
Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- clock.c | 4 ++-- port.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clock.c b/clock.c index 4532664..7af87fc 100644 --- a/clock.c +++ b/clock.c @@ -581,7 +581,7 @@ static enum servo_state clock_no_

[Linuxptp-devel] [PATCH 01/13] tmv: Add missing uses of tmv_zero()

2018-02-28 Thread Michael Brown
Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- mave.c | 2 +- tsproc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mave.c b/mave.c index fd09e5a..1a64f79 100644 --- a/mave.c +++ b/mave.c @@ -58,7 +58,7 @@ static void mave_reset(struct filter *

[Linuxptp-devel] [PATCH 05/13] tmv: Generalise tmv_eq() to tmv_cmp()

2018-02-28 Thread Michael Brown
Time values are compared using an inequality test in mmedian.c Generalise tmv_eq() to tmv_cmp() (by analogy with memcmp()) and replace existing uses of tmv_eq(). Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- clock.c | 2 +- mmedian.c | 3 ++- port.c| 2 +- tmv.h

[Linuxptp-devel] [PATCH 07/13] tmv: Convert tmv_t to a non-scalar type

2018-02-28 Thread Michael Brown
Enforce the use of the tmv_t wrapper functions by converting tmv_t from an int64_t to a struct containing an int64_t. Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- tmv.h | 47 --- 1 file changed, 32 insertions(+), 15 deletions(-)

[Linuxptp-devel] [PATCH 13/13] servo: Include fractional nanoseconds within clock offset

2018-02-28 Thread Michael Brown
calculations on absolute times therefore cannot make use of fractional nanoseconds. At present, only the PI servo is structured in a way that allows fractional nanoseconds to be used. Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- clock.c | 2 +- linreg.c| 3 ++- nt

[Linuxptp-devel] [PATCH 04/13] tmv: Add missing uses of tmv_to_nanoseconds()

2018-02-28 Thread Michael Brown
Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- clock.c | 2 +- tsproc.c | 10 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/clock.c b/clock.c index 7af87fc..e9e5d74 100644 --- a/clock.c +++ b/clock.c @@ -419,7 +419,7 @@ stat

[Linuxptp-devel] [PATCH 06/13] tmv: Add tmv_sign()

2018-02-28 Thread Michael Brown
The sign of time values is tested in tsproc.c. Add an abstraction tmv_sign() to return the sign of a time value. Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- tmv.h| 5 + tsproc.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tmv.h b/tmv.h

Re: [Linuxptp-devel] [PATCH 00/13] Prepare for sub-nanosecond timestamps

2018-03-01 Thread Michael Brown
On 01/03/18 06:40, Richard Cochran wrote: At first glance this series looks good. I expect to merge the first half or so, because we really do want the tmv_t operations to be used consistently. Regarding changing the implementation, I think we'll want to hold off on that until kernel support

Re: [Linuxptp-devel] [PATCH v2 09/10] tmv: Add converters for hardware timestamps

2018-03-12 Thread Michael Brown
On 09/03/18 11:22, Michael Brown wrote: Also, will you be able to mainline your driver?  It helps new kernel API acceptance when there is an actual, realistic use case and users. > I'm aiming to get the code up on GitHub as an out-of-tree driver today or early next week, and we

Re: [Linuxptp-devel] [PATCH 0/7] Use tmv_t abstraction for hardware timestamps

2018-03-15 Thread Michael Brown
On 12/03/18 12:36, Michael Brown wrote: This is a revised patch series to ensure that the tmv_t operations are used consistently for calculations involving hardware timestamps. The ugly hwts_to_tmv() and hwts_sw_to_tmv() wrappers from the previous patch series are gone. Instead we convert

Re: [Linuxptp-devel] [PATCH v2 08/10] tmv: Move struct hw_timestamp from msg.h to tmv.h

2018-03-08 Thread Michael Brown
On 08/03/18 04:39, Richard Cochran wrote: but is used in various places that care about the internal time representation. Move this definition to tmv.h as a more natural home. I'm not taking this patch because a) its not technically needed and b) I disagree about what is more natural. The

Re: [Linuxptp-devel] [PATCH v2 09/10] tmv: Add converters for hardware timestamps

2018-03-08 Thread Michael Brown
On 08/03/18 04:46, Richard Cochran wrote: On Thu, Mar 01, 2018 at 06:12:27PM +, Michael Brown wrote: Add converters between hardware timestamps and the internal representation, and remove code that directly manipulates the timespec within a hardware timestamp. Although I can see the point

Re: [Linuxptp-devel] [PATCH v2 09/10] tmv: Add converters for hardware timestamps

2018-03-09 Thread Michael Brown
On 09/03/18 01:40, Richard Cochran wrote: For the kernel, I (and others) would like to get away from the clunky timespec altogether. Dividing a time value into two fields might have made sense 30 years ago when operations on eight byte words were expensive, but today it makes no sense. It only

[Linuxptp-devel] [PATCH v2 05/10] tmv: Add missing uses of tmv_to_nanoseconds()

2018-03-01 Thread Michael Brown
Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- clock.c | 2 +- tsproc.c | 10 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/clock.c b/clock.c index e4f939a..53d9c75 100644 --- a/clock.c +++ b/clock.c @@ -419,7 +419,7 @@ stat

[Linuxptp-devel] [PATCH v2 03/10] tmv: Add missing uses of tmv_is_zero()

2018-03-01 Thread Michael Brown
Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- clock.c | 4 ++-- port.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clock.c b/clock.c index e733bdf..e4f939a 100644 --- a/clock.c +++ b/clock.c @@ -581,7 +581,7 @@ static enum servo_state clock_no_

[Linuxptp-devel] [PATCH v2 02/10] tmv: Add missing uses of tmv_zero()

2018-03-01 Thread Michael Brown
Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- mave.c | 2 +- tsproc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mave.c b/mave.c index fd09e5a..1a64f79 100644 --- a/mave.c +++ b/mave.c @@ -58,7 +58,7 @@ static void mave_reset(struct filter *

[Linuxptp-devel] [PATCH v2 04/10] tmv: Add missing uses of tmv_dbl()

2018-03-01 Thread Michael Brown
Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- tsproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsproc.c b/tsproc.c index 06c0184..b50c8e5 100644 --- a/tsproc.c +++ b/tsproc.c @@ -214,7 +214,7 @@ int tsproc_update_offset(struct tsproc *tsp, tmv_t *

[Linuxptp-devel] [PATCH v2 07/10] tmv: Add tmv_sign()

2018-03-01 Thread Michael Brown
The sign of time values is tested in tsproc.c. Add an abstraction tmv_sign() to return the sign of a time value. Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- tmv.h| 5 + tsproc.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tmv.h b/tmv.h

[Linuxptp-devel] [PATCH 10/13] clock: Pass floating point values to stats_add_value()

2018-03-04 Thread Michael Brown
Prepare for sub-nanosecond timestamps by passing clock offsets as floating point values to stats_add_value(). Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- clock.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/clock.c b/clock.c index f

[Linuxptp-devel] [PATCH v2 06/10] tmv: Generalise tmv_eq() to tmv_cmp()

2018-03-01 Thread Michael Brown
Time values are compared using an inequality test in mmedian.c Generalise tmv_eq() to tmv_cmp() (by analogy with memcmp()) and replace existing uses of tmv_eq(). Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- clock.c | 2 +- mmedian.c | 3 ++- port.c| 2 +- tmv.h

[Linuxptp-devel] [PATCH v2 09/10] tmv: Add converters for hardware timestamps

2018-03-01 Thread Michael Brown
Add converters between hardware timestamps and the internal representation, and remove code that directly manipulates the timespec within a hardware timestamp. Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- clock.c | 6 ++ clock.h | 2 +- port.c

[Linuxptp-devel] [PATCH v2 00/10] Prepare for sub-nanosecond timestamps

2018-03-01 Thread Michael Brown
onsistently across the codebase. Michael Brown (10): clock: Pass floating point values to stats_add_value() tmv: Add missing uses of tmv_zero() tmv: Add missing uses of tmv_is_zero() tmv: Add missing uses of tmv_dbl() tmv: Add missing uses of tmv_to_nanoseconds() tmv: Generalise tmv_eq() to tm

[Linuxptp-devel] [PATCH v2 01/10] clock: Pass floating point values to stats_add_value()

2018-03-01 Thread Michael Brown
Use tmv_dbl() to obtain the floating point value passed to stats_add_value() rather than relying on the existing implicit cast from the result of tmv_to_nanoseconds(). Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- clock.c | 13 + 1 file changed, 5 insertions

[Linuxptp-devel] [PATCH v2 08/10] tmv: Move struct hw_timestamp from msg.h to tmv.h

2018-03-01 Thread Michael Brown
The definition of struct hw_timestamp is not used anywhere in msg.c, but is used in various places that care about the internal time representation. Move this definition to tmv.h as a more natural home. Signed-off-by: Michael Brown <mbr...@fensystems.co.uk> --- msg.h | 13 -

[Linuxptp-devel] [PATCH v2 10/10] tmv: Convert tmv_t to a non-scalar type

2018-03-01 Thread Michael Brown
-by: Michael Brown <mbr...@fensystems.co.uk> --- tmv.h | 53 +++-- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/tmv.h b/tmv.h index 001963f..edfa577 100644 --- a/tmv.h +++ b/tmv.h @@ -53,90 +53,107 @@ struct hw_tim