[Linuxptp-devel] [PATCH RFC V2 01/10] Use SO_SELECT_ERR_QUEUE when available.

2014-11-05 Thread Richard Cochran
The current implementation fetches a transmit time stamp by polling on the socket with pollfd.events set to zero, and then checking if POLLERR has been returned by the kernel in pollfd.revents. This has the unfortunate side effect of sleeping in poll() for the entire time out duration, regardless o

[Linuxptp-devel] [PATCH RFC V2 05/10] config: remove useless parameter.

2014-11-05 Thread Richard Cochran
The 'cfg' passed to parse_port_setting() is never used, so just remove it. Signed-off-by: Richard Cochran --- config.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config.c b/config.c index 1c03fee..d5fa378 100644 --- a/config.c +++ b/config.c @@ -162,7 +162,6 @@ stat

[Linuxptp-devel] [PATCH RFC V2 04/10] trivial: update gitignore with the timemaster build product.

2014-11-05 Thread Richard Cochran
Signed-off-by: Richard Cochran --- .gitignore |1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0ca22af..68a4c3e 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /pmc /ptp4l /phc_ctl +/timemaster -- 1.7.10.4

[Linuxptp-devel] [PATCH RFC V2 09/10] Push the node's clock ID into the port data structure.

2014-11-05 Thread Richard Cochran
This patch lets the ports (rather than the clock) remember the clock ID, passing it back to the clock code during synchronization. This does not represent a functional change, but rather paves the way for ports to override the clock ID when running a "jbod" BC. Signed-off-by: Richard Cochran ---

[Linuxptp-devel] [PATCH RFC V2 02/10] Coding style: add missing break statement from a switch/case construct.

2014-11-05 Thread Richard Cochran
Signed-off-by: Richard Cochran --- port.c |1 + 1 file changed, 1 insertion(+) diff --git a/port.c b/port.c index caea891..f39ad1e 100644 --- a/port.c +++ b/port.c @@ -2183,6 +2183,7 @@ enum fsm_event port_event(struct port *p, int fd_index) break; cas

[Linuxptp-devel] [PATCH RFC V2 08/10] phc2sys: automatic mode: synchronize all non-slave ports.

2014-11-05 Thread Richard Cochran
When running a "jbod" Boundary Clock, as long as we have one slaved port, we always want the clocks on the other ports to be synchronized, regardless of their port state. Signed-off-by: Richard Cochran --- phc2sys.c | 40 +--- 1 file changed, 33 insertions(+

[Linuxptp-devel] [PATCH RFC V2 10/10] port: allow running a boundary clock with multiple clock devices.

2014-11-05 Thread Richard Cochran
If the user has configured the appropriate option, then simply warn about the clock device mismatch, open the port's clock device, and then go on. Signed-off-by: Richard Cochran --- port.c | 25 ++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/port.c b/p

[Linuxptp-devel] [PATCH RFC V2 00/10] Poor man's boundary clock

2014-11-05 Thread Richard Cochran
Here is my current series. The first patch is the improved Tx time stamp polling, and patches 2-5 are trivial clean ups. Patches 6-10 represent my second attempt at the "jbod" BC. With any luck, this should work. Compile tested only! (We still would need to change the max_adj for the servo, and m

[Linuxptp-devel] [PATCH RFC V2 07/10] phc2sys: make automatic mode actually work.

2014-11-05 Thread Richard Cochran
The reconfigure function unnecessarily clears the 'new_state' variable. On the second and subsequent calls, this zero value incorrectly clobbers the state of any port whose state has *not* changed. If, for example, a port in the MASTER state goes FAULTY, when it returns to MASTER state, phc2sys wi

[Linuxptp-devel] [PATCH RFC V2 06/10] config: add a option to enable a poor man's boundary clock.

2014-11-05 Thread Richard Cochran
This patch adds a configuration option that allows running a boundary clock using "just a bunch of devices". Normally each port is probed to make sure they all share the same PTP hardware clock, but this option will allow a heterogeneous collection of devices, should the user really want it. Signe

[Linuxptp-devel] [PATCH RFC V2 03/10] trivial: do not assign a FP constant to an integer.

2014-11-05 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 726999e..df82d2b 100644 --- a/clock.c +++ b/clock.c @@ -789,7 +789,7 @@ struct clock *clock_create(int phc_index, struct interfaces_head *ifaces,

Re: [Linuxptp-devel] [PATCH] port: fix fda initialization.

2014-11-05 Thread Richard Cochran
On Wed, Nov 05, 2014 at 12:22:43PM +0100, Miroslav Lichvar wrote: > Initialize all descriptors to prevent polling invalid descriptors from > faulty ports. > > Signed-off-by: Miroslav Lichvar > --- > port.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/port.c b/por

Re: [Linuxptp-devel] [PATCH RFC 0/3] Poor man's boundary clock

2014-11-05 Thread Richard Cochran
On Wed, Nov 05, 2014 at 08:28:04PM +0100, Jiri Benc wrote: > > I'm not sure whether this patch was enough to support the boundary > clock or more was needed but I remember I had the boundary clock stuff > done (though untested) and I cannot find anything on top of this, so > this was probably enou

Re: [Linuxptp-devel] [PATCH RFC 0/3] Poor man's boundary clock

2014-11-05 Thread Jiri Benc
On Wed, 5 Nov 2014 19:58:32 +0100, Richard Cochran wrote: > On Wed, Nov 05, 2014 at 05:56:28PM +0100, Jiri Benc wrote: > > My plan for the next steps has been allowing ptp4l to work with > > multiple independent PHCs that would form a PTP clock (and rely on > > phc2sys to sync those PHCs). > > Doe

Re: [Linuxptp-devel] [PATCH RFC 0/3] Poor man's boundary clock

2014-11-05 Thread Richard Cochran
On Wed, Nov 05, 2014 at 05:56:28PM +0100, Jiri Benc wrote: > My plan for the next steps has been allowing ptp4l to work with multiple > independent PHCs that would form a PTP clock (and rely on phc2sys to > sync those PHCs). Doesn't my patch #2 do this? > This needs separation of struct clock int

Re: [Linuxptp-devel] [PATCH RFC 0/3] Poor man's boundary clock

2014-11-05 Thread Jiri Benc
On Wed, 5 Nov 2014 17:34:23 +0100, Richard Cochran wrote: > I like the idea of "automatic" phc2sys, if it would only work right. It's definitely not complete yet and I'm not surprised there are bugs (although I did my best to support also future cases, it's hard to get it right without the actual

Re: [Linuxptp-devel] [PATCH RFC 0/3] Poor man's boundary clock

2014-11-05 Thread Richard Cochran
On Wed, Nov 05, 2014 at 03:02:14PM +0100, Miroslav Lichvar wrote: > > But I'm wondering how difficult it would be to implement a BC from > separate PHCs more cleanly. How about adding a new virtual transport > that uses clock_gettime() to timestamp the messages, create a clock > instance in ptp4l

Re: [Linuxptp-devel] [PATCH RFC 0/3] Poor man's boundary clock

2014-11-05 Thread Richard Cochran
On Wed, Nov 05, 2014 at 03:02:14PM +0100, Miroslav Lichvar wrote: > The PHC device would need to be reopened when a new port becomes > slave. I assumed the code did this. Oh well. That needs to be fixed. > There is also the problem that the master port will be sending sync > messages before it's

Re: [Linuxptp-devel] [PATCH RFC 0/3] Poor man's boundary clock

2014-11-05 Thread Miroslav Lichvar
On Sat, Nov 01, 2014 at 08:00:21PM +0100, Richard Cochran wrote: > Before releasing v1.5, I wanted to test phc2sys's new automatic mode > in order to run a BC using a bunch of PCIe cards, but I found it did > not quite work. First of all, the port logic bails out when the PHC > device don't match,

[Linuxptp-devel] [PATCH] clock: keep ports in specified order.

2014-11-05 Thread Miroslav Lichvar
When adding a new port, put it at the end of the list instead of head. This restores the order of received management messages as was before commit 08575133. Signed-off-by: Miroslav Lichvar --- clock.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/clock.c b/clock.c

[Linuxptp-devel] [PATCH] port: fix fda initialization.

2014-11-05 Thread Miroslav Lichvar
Initialize all descriptors to prevent polling invalid descriptors from faulty ports. Signed-off-by: Miroslav Lichvar --- port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/port.c b/port.c index aae5910..6ce63f7 100644 --- a/port.c +++ b/port.c @@ -1401,7 +1401,7 @@ st