Re: [Linuxptp-devel] [PATCH RFC 4/6] clock: set sample weight.
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
|
From: Miroslav L. <mli...@re...> - 2015-02-17 11:35:24
|
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 (sync_delay_rate <= 0 && servo_weight_samples(c->servo)) {
> > + /* Get new sample delay with updated t1 and t2 */
> > + sample_delay = clock_get_sample_delay(c);
> > +
> > + 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?
Yes, I thought the displayed delay should correspond to the offset and
not mix the sample offset with filtered delay. Maybe it would be
cleaner to add a new field to the clock structure for this?
--
Miroslav Lichvar
|