On Mon, Feb 16, 2015 at 08:48:15PM +0100, Richard Cochran wrote:
> On Fri, Feb 13, 2015 at 01:56:16PM +0100, Miroslav Lichvar wrote:
> > + if (sample_delay > 0 && c->path_delay > 0) {
> > + weight = (double)c->path_delay / sample_delay;
> > + if (weight > 1.0)
> > + weight = 1.0;
> > + pr_debug("delay sample %9" PRId64 " filtered %9" PRId64
> > + " weight %f",
> > + sample_delay, c->path_delay, weight);
> > + c->path_delay = sample_delay;
>
> So now, c->path_delay is set once in clock_path_delay() using
> averaging, and here the averaged value is used for the ratio, but then
> you clobber c->path_delay with the new value?
>
> Your intention would be more clear if you would not set c->path_delay
> here, but rather use a local variable.
Setting c->path_delay here is actually a bug breaking the weight
calculation if there is no delay measurement before next sync message,
the new weight will be 1.0 as the filtered delay will actually be the
raw delay.
--
Miroslav Lichvar
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel