[Linuxptp-devel] [PATCH RFC 0/2] Fix one-step regression

2016-10-16 Thread Richard Cochran
Due to a bug in the setup code refactoring (in anticipation of TC support) in v1.7 you cannot dial one-step anymore. This series addresses that issue. Richard Cochran (2): Fix regression in one-step configuration. clock: Remove cruft from the creation method. clock.c | 8 1 file ch

[Linuxptp-devel] [PATCH RFC 2/2] clock: Remove cruft from the creation method.

2016-10-16 Thread Richard Cochran
The time stamping setup code needlessly queries the configuration data base over and over, rather than simply using the local variable already assigned. This patch replaces the extraneous config_get_int() calls with the local variable. Signed-off-by: Richard Cochran --- clock.c | 7 +++ 1 f

[Linuxptp-devel] [PATCH RFC 1/2] Fix regression in one-step configuration.

2016-10-16 Thread Richard Cochran
We activate on-step mode based on the "time_stamping" and "twoStepFlag" configuration options. If twoStepFlag is false and HW time stamping is enabled, we upgrade the time stamping mode variable to one-step. The code that tests the options and sets the one-step mode moved from ptp4l.c into clock.

[Linuxptp-devel] [PATCH V3 6/7] port: Provide methods to set and get the link status.

2016-10-16 Thread Richard Cochran
Signed-off-by: Richard Cochran --- port.c | 13 + port.h | 14 ++ 2 files changed, 27 insertions(+) diff --git a/port.c b/port.c index 5868983..a1ad6f6 100644 --- a/port.c +++ b/port.c @@ -117,6 +117,7 @@ struct port { int path_trace_enabled;

[Linuxptp-devel] [PATCH V3 0/7] Link state tracking

2016-10-16 Thread Richard Cochran
Changes in V3: ~~ - Free rtnl's malloc'ed buffer on the exit path. Changes in V2: ~~ - Add more explanation to patch #7 - Fix missing parenthesis in the realloc() size in patch #7 This series implements link state tracking over all port via a single RT netlink socket. Unf

[Linuxptp-devel] [PATCH V3 4/7] clock: Fix coding style within a helper function.

2016-10-16 Thread Richard Cochran
No functional changes. Signed-off-by: Richard Cochran --- clock.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/clock.c b/clock.c index 55532b8..3b42109 100644 --- a/clock.c +++ b/clock.c @@ -768,20 +768,22 @@ static int clock_add_port(struct clock *c, int ph

[Linuxptp-devel] [PATCH V3 1/7] rtnl: Introduce RT netlink sockets.

2016-10-16 Thread Richard Cochran
This patch adds a source module that implements RT netlink sockets for the purpose of link monitoring. Unfortunately the netlink API offers no possibility for per-port notification. Instead it forces us to use a de-multiplexing pattern. Signed-off-by: Richard Cochran --- makefile | 2 +- rtn

[Linuxptp-devel] [PATCH V3 3/7] clock: Remove stray semicolon.

2016-10-16 Thread Richard Cochran
Signed-off-by: Richard Cochran --- clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clock.c b/clock.c index 8ca749e..55532b8 100644 --- a/clock.c +++ b/clock.c @@ -314,7 +314,7 @@ static void clock_freq_est_reset(struct clock *c) c->fest.origin1 = tmv_zero();

[Linuxptp-devel] [PATCH V3 2/7] sk: Add a method to obtain a socket for utility purposes.

2016-10-16 Thread Richard Cochran
The clock module will want to know the interface indexes, in order to implement link monitoring. However, the clock does not open any sockets directly. This helper function lets us keep the clock module free of socket level code. Signed-off-by: Richard Cochran --- sk.c | 10 ++ sk.h |

[Linuxptp-devel] [PATCH V3 7/7] clock: Monitor the link status using a RT netlink socket.

2016-10-16 Thread Richard Cochran
Poll for link up/down events. When a link goes down, the port becomes faulty until the link goes up again. We keep the fault timer from the existing fault detection, but a downed link prevents clear the fault. The new state machine is depicted in this ascii art diagram: ++

[Linuxptp-devel] [PATCH V3 5/7] clock: Remember each port's interface index.

2016-10-16 Thread Richard Cochran
We use a hash table to remember the mapping. Since our existing hash table is a simply string hash, we convert the integer index into a decimal string. Although hashing integers in this way is sub-optimal, the table will not be used in a performance critical path. Signed-off-by: Richard Cochran

[Linuxptp-devel] Planning release 1.8

2016-10-16 Thread Richard Cochran
Dear linuxptp users and developers, I am planning to release version 1.8 in one week, without any major new features, in order to fix the regression in version 1.7. [ Sound familiar? The same thing happened to 1.6. I don't have the time to maintain stable branches, and so my policy is to push

[Linuxptp-devel] [PATCH RFC 6/6] p2p_tc: implement a peer to peer transparent clock.

2016-10-16 Thread Richard Cochran
Signed-off-by: Richard Cochran --- clock.c| 2 +- makefile | 2 +- p2p_tc.c | 155 + port.c | 3 ++ port_private.h | 3 ++ 5 files changed, 163 insertions(+), 2 deletions(-) create mode 100644 p2p_tc.c d

[Linuxptp-devel] [PATCH RFC 4/6] port: share init code, peer delay code, and helpers

2016-10-16 Thread Richard Cochran
This patch makes a number of subroutines into global functions in order to share code with the TC implementations to come. Signed-off-by: Richard Cochran --- port.c | 28 +--- port_private.h | 17 + 2 files changed, 30 insertions(+), 15 deletions(-

[Linuxptp-devel] [PATCH RFC 2/6] port: make the dispatch and event methods variable based on clock type.

2016-10-16 Thread Richard Cochran
Signed-off-by: Richard Cochran --- port.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/port.c b/port.c index a1ad6f6..4f91dfd 100644 --- a/port.c +++ b/port.c @@ -72,6 +72,10 @@ struct port { struct fdarray fda; int fault_fd; int phc_ind

[Linuxptp-devel] [PATCH RFC 1/6] ptp4l: add a command line switch for TC mode.

2016-10-16 Thread Richard Cochran
This patch adds a new flag '-t' that enables transparent clock mode. When active, the clock will be created as an E2E or P2P TC, depending on the configured delay mechanism. Signed-off-by: Richard Cochran --- ptp4l.c | 39 +++ 1 file changed, 35 insertions(+)

[Linuxptp-devel] [PATCH RFC 3/6] port: export a private interface.

2016-10-16 Thread Richard Cochran
This patch places the internal port data structure into a common header for use by the original BC and the new TC code. Signed-off-by: Richard Cochran --- port.c | 84 +-- port_private.h | 111 ++

[Linuxptp-devel] [PATCH RFC 0/6] TC proof of concept

2016-10-16 Thread Richard Cochran
So here is my draft for P2P TC support. I rebased this on top of the RTNL series posted today. The TC code is getting a bit stale by now, and so this version is compile tested only! Just to be clear, this code is NOT going into v1.8! The TC support is only a proof of concept, and much more work

[Linuxptp-devel] [PATCH RFC 5/6] tc: add the transparent clock implementation.

2016-10-16 Thread Richard Cochran
This patch adds code that sends an event messages received on one port out all the other ports and calculates the residence time. The correction, ingress port, and the original message are remembered in a TC transmit descriptor. These descriptors are recycled in a memory pool in a similar way to