Re: [B.A.T.M.A.N.] [PATCH v2 6/7] batman-adv: ELP - use tp meter to estimate the throughput if otherwise not available

Marek Lindner
2018-08-04T09:35:22Z

[-- Attachment #1: Type: text/plain, Size: 1167 bytes --]

On Monday, 21 May 2018 22:43:04 HKT Linus Lüssing wrote:
> On Fri, May 18, 2018 at 09:47:53AM +0800, Marek Lindner wrote:
> > +fallback_throughput:
> > + last_tp_run_jiffies = jiffies - neigh->bat_v.last_tp_meter_run;
> > + last_tp_run_msecs = jiffies_to_msecs(last_tp_run_jiffies);
> > +
> > + /* check the tp_meter_running flag before checking the timestamp
> > to
> > + * avoid a race condition where a new tp meter session is
> > scheduled
> > + * right after the previous tp meter session has completed
> > + */
> > + if (!neigh->bat_v.tp_meter_running &&
> > + last_tp_run_msecs > BATADV_ELP_TP_RUN_INTERVAL)
> > + batadv_v_elp_tp_start(neigh);
> > +
> > + /* discard too old tp test results */
> > + if (last_tp_run_msecs > 2 * BATADV_ELP_TP_RUN_INTERVAL)
> > + neigh->bat_v.tp_meter_throughput = 0;
> > +
>
> So far we were either using time_before(), time_after_eq() or our
> own wrapper batadv_has_timed_out(). Would it make sense to use
> some of these here, too?

Good point. That changes has been staged for v3.

Cheers,
Marek

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 488 bytes --]