On Wed, Mar 11, 2015 at 01:28:05PM +0100, Miroslav Lichvar wrote:
> On Mon, Mar 09, 2015 at 08:53:52PM +0100, Richard Cochran wrote:
> > There has got to be a nicer way to arrange the code to make this
> > work.  Once we add a "balanced mode" that works better in some
> > situations, people will want other balanced mode algorithms.
> 
> Hm, are there any other algorithms suitable for that?

I should think so.  Just looking at the first graph of

   https://mlichvar.fedorapeople.org/tmp/ptp/ptp4l_error2.png

I would think simply comparing the sampled offset with the average
offset and scaling (or pruning) it would be at least as effective as
looking at the delay.  Plus it would not depend on "balanced" rates.

> To me, it would make more sense to calculate the delay and offset at
> one place. How about the following approach instead?
> 
> - introduce a "time stamp processor" (tsproc.c)
>   - input is t1-t4, c1-c3, clock rate ratio and update rate of t1t2 to t3t4
>   - output is offset, delay and weight
>   - the delay filter is there
>   - according to the configuration and t1t2/t3r4 rate, it either
>     returns raw offset/delay or values based on filtered delay
>   - weighting is configurable too
> - clock.c doesn't store t1-t4 and doesn't filter delay, it only calls
>   tsproc_update* functions with new input and tsproc_getsample() to
>   get a sample for the servo, print it and update the statistics
> - port.c can use this too, deduplicating the delay calculation and
>   delay filtering

(The delay must be per port, for P2P mode.)

> Does it make sense?

Yes, that is the right direction.

Thanks,
Richard

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to