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
The NetSync Monitor protocol will require us to report the time stamp of
the last synchronization. This patch adds new the method.
Signed-off-by: Richard Cochran
---
clock.c | 5 +
clock.h | 7 +++
2 files changed, 12 insertions(+)
diff --git a/clock.c
We are going to need multiple TLV support soon rather than later, in
order to support various unicast profiles for example. I want to get
this in before adding any more TLV code, and so I'll rework the NSM
support on top of this.
This series removes the single TLV limitation. What PITA that
(reposting this, because SF block me as a spammer!)
On Tue, Feb 27, 2018 at 01:19:35PM -0500, Joey DiGiorgio wrote:
> I tried commenting that section out in missing.h, but I was thinking
> it should already be handled by the #ifndef
Right.
> and I've been having
> issues getting Linux PTP
This patch adds a new "NSM" program. The new code handles only one
outstanding NSM command at a time. If and when all four event time
stamps have arrived, the code prints the instantaneous estimated
offset without any averaging or smoothing.
Signed-off-by: Richard Cochran
We always but braces around 'if' blocks.
Signed-off-by: Richard Cochran
---
port.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/port.c b/port.c
index 263638c..2ee3ac6 100644
--- a/port.c
+++ b/port.c
@@ -2426,8 +2426,9 @@ int
This series adds support for Meinberg Funkuhren's NetSync Monitor
(NSM) protocol. NSM allows a node with a local time reference (like a
GM using GPS) to measure the offset of a given clock. In a nutshell,
NSM works by having the node to be measured act like a unicast master
clock on demand.
1.
All users have been converted to the TLV list, so remove the field.
Signed-off-by: Richard Cochran
---
msg.c | 1 -
msg.h | 6 --
2 files changed, 7 deletions(-)
diff --git a/msg.c b/msg.c
index 348b7b5..8bc14f8 100644
--- a/msg.c
+++ b/msg.c
@@ -462,7 +462,6 @@
The third parameter of the function, pmc_send(), is never used. This patch
removes it.
Signed-off-by: Richard Cochran
---
pmc_common.c | 8 +++-
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/pmc_common.c b/pmc_common.c
index 4ece489..91fffb3 100644
Valgrind is nagging us, saying we pass uninitialized data through a
setsockopt() call. This patch fixes the issue by clearing the entire
passed structure.
Signed-off-by: Richard Cochran
---
raw.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/raw.c b/raw.c
index
When NSM is enabled on a given port, that port always replies to a NSM
delay request with a delay response, sync, and follow up, regardless
of the current state of the port.
Signed-off-by: Richard Cochran
---
port.c | 132
The code uses a local variable for program flow control in a silly way.
This patch simplifies the logic by using the common switch/case/default
pattern instead.
Signed-off-by: Richard Cochran
---
clock.c | 38 +-
1 file changed, 13
---
clock.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/clock.c b/clock.c
index 069795a..427ca6c 100644
--- a/clock.c
+++ b/clock.c
@@ -335,11 +335,11 @@ static int clock_management_fill_response(struct clock
*c, struct port *p,
I've been working on multiple TLV support, and I rebased the NSM
series on top of that. Along the way I made a number of minor fixes.
This series collects them all together.
Richard Cochran (10):
msg: Share a static global more globally.
raw: Fix valgrind setsockopt warning.
port: Clean up
The current code uses an ad hoc method of appending TLVs. When
constructing a message, the code computes the total PDU length by adding
the message size to the TLV size. By using the new API, this patch
simplifies message construction, letting each TLV add its own length
to the total.
As a
We indent with tabs, not spaces.
Signed-off-by: Richard Cochran
---
pmc.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/pmc.c b/pmc.c
index af9cc63..49282a6 100644
--- a/pmc.c
+++ b/pmc.c
@@ -233,19 +233,19 @@ static void
Now that the list is in place and is used on all transmit paths, simply
iterate through the list when converting to network byte order.
Signed-off-by: Richard Cochran
---
msg.c | 23 ++-
1 file changed, 6 insertions(+), 17 deletions(-)
diff --git
In order to support multiple TLVs, the transmit code must be able to
append one TLV after another. This patch adds a method that checks
whether there is room, allocates the TLV descriptor, sets the buffer
pointer, and appends the descriptor to the list.
Signed-off-by: Richard Cochran
Any code that wants to call one_step() needs to link with the static
global 'assume_two_step'. This patch moves that variable's definition
from ptp4l.c to msg.c. Not only is that file the more natural choice
(since the variable is used on msg.h) but also this allows other
programs to call the
Signed-off-by: Richard Cochran
---
msg.c | 3 +++
tlv.c | 32
tlv.h | 21 +
3 files changed, 56 insertions(+)
diff --git a/msg.c b/msg.c
index 6943431..52a59e7 100644
--- a/msg.c
+++ b/msg.c
@@ -213,6 +213,9 @@ void
Signed-off-by: Michael Brown
---
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 @@ static int
Signed-off-by: Michael Brown
---
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
Signed-off-by: Michael Brown
---
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 *filter)
Signed-off-by: Michael Brown
---
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 *offset,
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
---
tmv.h| 5 +
tsproc.c | 5 +++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/tmv.h b/tmv.h
index
Re-arrange local variables into a more legible reverse Christmas tree.
Signed-off-by: Richard Cochran
---
port.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/port.c b/port.c
index 6cc5dd0..76af2ae 100644
--- a/port.c
+++ b/port.c
@@
We are programming C, not Java, and so opening braces of a function
belong on a line all by themselves.
Signed-off-by: Richard Cochran
---
tlv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tlv.c b/tlv.c
index cef10a0..a5c2eb3 100644
---
Signed-off-by: Richard Cochran
---
config.c| 1 +
default.cfg | 1 +
gPTP.cfg| 1 +
port.c | 1 +
ptp4l.8 | 12 +++-
5 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/config.c b/config.c
index 56d1556..ba035ac 100644
---
The NetSync Monitor protocol features a TLV with a length of zero.
Our input message parsing assumes that every TLV will have some sort
of payload, and up until now this was true. This patch adjusts the
parsing code to accept TLVs of length zero.
Signed-off-by: Richard Cochran
The file, pmc.c, contains utility functions for printing out a port address
structure. We will want to call these functions from pmc_common.c, and so
this patch moves the utility functions where they belong.
Signed-off-by: Richard Cochran
---
pmc.c | 48
The code uses a local variable for program flow control in a silly way.
This patch simplifies the logic by using the common switch/case/default
pattern instead.
Signed-off-by: Richard Cochran
---
port.c | 35 ++-
1 file changed, 14
This patch adds support for packing and unpacking the NSM TLVs. In
addition, it introduces macros to make the ntoh/htoh boilerplate easier
to read. The idea is to reduce the number of monstrous muti-line
assignments like:
pds->grandmasterClockQuality.offsetScaledLogVariance =
As part of the NetSync Monitor protocol, the port will need to have
access to the current data set. This patch adds the appropriate
function.
Signed-off-by: Richard Cochran
---
clock.c | 5 +
clock.h | 7 +++
2 files changed, 12 insertions(+)
diff --git
This will be needed in order to support the NetSync Monitor protocol.
Signed-off-by: Richard Cochran
---
msg.c | 3 ++-
msg.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/msg.c b/msg.c
index 9038616..a36d4d0 100644
--- a/msg.c
+++ b/msg.c
@@
This will be needed in order to generate a TLV for the NSM protocol.
Signed-off-by: Richard Cochran
---
tmv.h | 15 +++
1 file changed, 15 insertions(+)
diff --git a/tmv.h b/tmv.h
index 30b41ee..5d1e12b 100644
--- a/tmv.h
+++ b/tmv.h
@@ -96,6 +96,21 @@
Signed-off-by: Richard Cochran
---
pmc_common.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/pmc_common.c b/pmc_common.c
index 447cf99..c1b0d3e 100644
--- a/pmc_common.c
+++ b/pmc_common.c
@@ -314,6 +314,7 @@ struct ptp_message *pmc_recv(struct pmc *pmc)
In order to support multiple TLVs per message, a list is needed.
This patch adds the list to the message structure. This list will
eventually replace the 'last_tlv' field.
Signed-off-by: Richard Cochran
---
msg.c | 16
msg.h | 5 +
2 files
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
---
clock.c | 2 +-
mmedian.c | 3 ++-
port.c| 2 +-
tmv.h | 4 ++--
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
---
clock.c | 6 ++
clock.h | 2 +-
port.c | 69
>> Would you like me to respin a v2 series which contains only the patches that
>> will not impose a speed penalty?
>
> Yes, please.
Herewith the revised patch series. I've reworked a couple of the
patches to fit with the focus of simply ensuring that tmv_t is used
consistently across the
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
---
clock.c | 13 +
1 file changed, 5 insertions(+), 8
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
---
msg.h | 13 -
tmv.h |
Enforce the use of the tmv_t wrapper functions by converting tmv_t
from an int64_t to a struct containing an int64_t.
Inspection of the disassembly shows that this change has essentially
no impact on the resulting object code, at least for x86_64 with
compiler optimisations enabled.
43 matches
Mail list logo