On Wed, 2017-11-08 at 13:09 -0800, Dave Taht wrote:
> Slotting is a crude approximation of the behaviors of shared media such
> as cable, wifi, and LTE, which gather up a bunch of packets within a
> varying delay window and deliver them, relative to that, nearly all at
> once.
> - qdisc_watchdog_schedule_ns(&q->watchdog, time_to_send);
> +
> + if (q->slot.slot_next > now)
> + qdisc_watchdog_schedule_ns(&q->watchdog,
> + q->slot.slot_next);
> + else
> + qdisc_watchdog_schedule_ns(&q->watchdog, time_to_send);
This looks weird.
You might incur an extra timer event in the following case :
now < q->slot.slot_next < time_to_send
I would rather do
qdisc_watchdog_schedule_ns(&q->watchdog,
max(time_to_send, q->slot.slot_next));
So that a single timer expiration is needed.