Commit 34c5d292 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

sch_api: introduce qdisc_watchdog_schedule_ns()

tbf will need to schedule watchdog in ns. No need to convert it twice.
Signed-off-by: default avatarJiri Pirko <jiri@resnulli.us>
Acked-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 292f1c7f
...@@ -65,8 +65,14 @@ struct qdisc_watchdog { ...@@ -65,8 +65,14 @@ struct qdisc_watchdog {
}; };
extern void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc); extern void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc);
extern void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, extern void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd, u64 expires);
psched_time_t expires);
static inline void qdisc_watchdog_schedule(struct qdisc_watchdog *wd,
psched_time_t expires)
{
qdisc_watchdog_schedule_ns(wd, PSCHED_TICKS2NS(expires));
}
extern void qdisc_watchdog_cancel(struct qdisc_watchdog *wd); extern void qdisc_watchdog_cancel(struct qdisc_watchdog *wd);
extern struct Qdisc_ops pfifo_qdisc_ops; extern struct Qdisc_ops pfifo_qdisc_ops;
......
...@@ -493,7 +493,7 @@ void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc) ...@@ -493,7 +493,7 @@ void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc)
} }
EXPORT_SYMBOL(qdisc_watchdog_init); EXPORT_SYMBOL(qdisc_watchdog_init);
void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, psched_time_t expires) void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd, u64 expires)
{ {
if (test_bit(__QDISC_STATE_DEACTIVATED, if (test_bit(__QDISC_STATE_DEACTIVATED,
&qdisc_root_sleeping(wd->qdisc)->state)) &qdisc_root_sleeping(wd->qdisc)->state))
...@@ -502,10 +502,10 @@ void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, psched_time_t expires) ...@@ -502,10 +502,10 @@ void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, psched_time_t expires)
qdisc_throttled(wd->qdisc); qdisc_throttled(wd->qdisc);
hrtimer_start(&wd->timer, hrtimer_start(&wd->timer,
ns_to_ktime(PSCHED_TICKS2NS(expires)), ns_to_ktime(expires),
HRTIMER_MODE_ABS); HRTIMER_MODE_ABS);
} }
EXPORT_SYMBOL(qdisc_watchdog_schedule); EXPORT_SYMBOL(qdisc_watchdog_schedule_ns);
void qdisc_watchdog_cancel(struct qdisc_watchdog *wd) void qdisc_watchdog_cancel(struct qdisc_watchdog *wd)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment