diff options
author | Eric Dumazet <edumazet@google.com> | 2020-03-17 05:12:49 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-03-18 07:16:34 +0300 |
commit | efe074c2cc1c67021481f56ba87cc61d1ab03e33 (patch) | |
tree | a97d0f4458701cf87a11d2d1403369d1cf30eb7c /net/sched/sch_api.c | |
parent | 24ee86511b01f73a1ef1dd8a8a2e685e5ec03bfe (diff) |
net_sched: add qdisc_watchdog_schedule_range_ns()
Some packet schedulers might want to add a slack
when programming hrtimers. This can reduce number
of interrupts and increase batch sizes and thus
give good xmit_more savings.
This commit adds qdisc_watchdog_schedule_range_ns()
helper, with an extra delta_ns parameter.
Legacy qdisc_watchdog_schedule_n() becomes an inline
passing a zero slack.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_api.c')
-rw-r--r-- | net/sched/sch_api.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 50794125bf02..83984be04f57 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -618,7 +618,8 @@ void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc) } EXPORT_SYMBOL(qdisc_watchdog_init); -void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd, u64 expires) +void qdisc_watchdog_schedule_range_ns(struct qdisc_watchdog *wd, u64 expires, + u64 delta_ns) { if (test_bit(__QDISC_STATE_DEACTIVATED, &qdisc_root_sleeping(wd->qdisc)->state)) @@ -628,11 +629,12 @@ void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd, u64 expires) return; wd->last_expires = expires; - hrtimer_start(&wd->timer, - ns_to_ktime(expires), - HRTIMER_MODE_ABS_PINNED); + hrtimer_start_range_ns(&wd->timer, + ns_to_ktime(expires), + delta_ns, + HRTIMER_MODE_ABS_PINNED); } -EXPORT_SYMBOL(qdisc_watchdog_schedule_ns); +EXPORT_SYMBOL(qdisc_watchdog_schedule_range_ns); void qdisc_watchdog_cancel(struct qdisc_watchdog *wd) { |