diff options
-rw-r--r-- | include/net/pkt_sched.h | 8 | ||||
-rw-r--r-- | net/sched/sch_api.c | 4 | ||||
-rw-r--r-- | net/sched/sch_cbq.c | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 120935b2abd8..82a3191375f5 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h | |||
@@ -43,15 +43,15 @@ typedef long psched_tdiff_t; | |||
43 | 43 | ||
44 | /* Avoid doing 64 bit divide */ | 44 | /* Avoid doing 64 bit divide */ |
45 | #define PSCHED_SHIFT 6 | 45 | #define PSCHED_SHIFT 6 |
46 | #define PSCHED_US2NS(x) ((s64)(x) << PSCHED_SHIFT) | 46 | #define PSCHED_TICKS2NS(x) ((s64)(x) << PSCHED_SHIFT) |
47 | #define PSCHED_NS2US(x) ((x) >> PSCHED_SHIFT) | 47 | #define PSCHED_NS2TICKS(x) ((x) >> PSCHED_SHIFT) |
48 | 48 | ||
49 | #define PSCHED_TICKS_PER_SEC PSCHED_NS2US(NSEC_PER_SEC) | 49 | #define PSCHED_TICKS_PER_SEC PSCHED_NS2TICKS(NSEC_PER_SEC) |
50 | #define PSCHED_PASTPERFECT 0 | 50 | #define PSCHED_PASTPERFECT 0 |
51 | 51 | ||
52 | static inline psched_time_t psched_get_time(void) | 52 | static inline psched_time_t psched_get_time(void) |
53 | { | 53 | { |
54 | return PSCHED_NS2US(ktime_to_ns(ktime_get())); | 54 | return PSCHED_NS2TICKS(ktime_to_ns(ktime_get())); |
55 | } | 55 | } |
56 | 56 | ||
57 | static inline psched_tdiff_t | 57 | static inline psched_tdiff_t |
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 32009793307b..24d17ce9c294 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
@@ -484,7 +484,7 @@ void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, psched_time_t expires) | |||
484 | 484 | ||
485 | wd->qdisc->flags |= TCQ_F_THROTTLED; | 485 | wd->qdisc->flags |= TCQ_F_THROTTLED; |
486 | time = ktime_set(0, 0); | 486 | time = ktime_set(0, 0); |
487 | time = ktime_add_ns(time, PSCHED_US2NS(expires)); | 487 | time = ktime_add_ns(time, PSCHED_TICKS2NS(expires)); |
488 | hrtimer_start(&wd->timer, time, HRTIMER_MODE_ABS); | 488 | hrtimer_start(&wd->timer, time, HRTIMER_MODE_ABS); |
489 | } | 489 | } |
490 | EXPORT_SYMBOL(qdisc_watchdog_schedule); | 490 | EXPORT_SYMBOL(qdisc_watchdog_schedule); |
@@ -1680,7 +1680,7 @@ static int psched_show(struct seq_file *seq, void *v) | |||
1680 | 1680 | ||
1681 | hrtimer_get_res(CLOCK_MONOTONIC, &ts); | 1681 | hrtimer_get_res(CLOCK_MONOTONIC, &ts); |
1682 | seq_printf(seq, "%08x %08x %08x %08x\n", | 1682 | seq_printf(seq, "%08x %08x %08x %08x\n", |
1683 | (u32)NSEC_PER_USEC, (u32)PSCHED_US2NS(1), | 1683 | (u32)NSEC_PER_USEC, (u32)PSCHED_TICKS2NS(1), |
1684 | 1000000, | 1684 | 1000000, |
1685 | (u32)NSEC_PER_SEC/(u32)ktime_to_ns(timespec_to_ktime(ts))); | 1685 | (u32)NSEC_PER_SEC/(u32)ktime_to_ns(timespec_to_ktime(ts))); |
1686 | 1686 | ||
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index d728d8111732..23a167670fd5 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c | |||
@@ -509,7 +509,7 @@ static void cbq_ovl_delay(struct cbq_class *cl) | |||
509 | q->pmask |= (1<<TC_CBQ_MAXPRIO); | 509 | q->pmask |= (1<<TC_CBQ_MAXPRIO); |
510 | 510 | ||
511 | expires = ktime_set(0, 0); | 511 | expires = ktime_set(0, 0); |
512 | expires = ktime_add_ns(expires, PSCHED_US2NS(sched)); | 512 | expires = ktime_add_ns(expires, PSCHED_TICKS2NS(sched)); |
513 | if (hrtimer_try_to_cancel(&q->delay_timer) && | 513 | if (hrtimer_try_to_cancel(&q->delay_timer) && |
514 | ktime_to_ns(ktime_sub( | 514 | ktime_to_ns(ktime_sub( |
515 | hrtimer_get_expires(&q->delay_timer), | 515 | hrtimer_get_expires(&q->delay_timer), |
@@ -620,7 +620,7 @@ static enum hrtimer_restart cbq_undelay(struct hrtimer *timer) | |||
620 | ktime_t time; | 620 | ktime_t time; |
621 | 621 | ||
622 | time = ktime_set(0, 0); | 622 | time = ktime_set(0, 0); |
623 | time = ktime_add_ns(time, PSCHED_US2NS(now + delay)); | 623 | time = ktime_add_ns(time, PSCHED_TICKS2NS(now + delay)); |
624 | hrtimer_start(&q->delay_timer, time, HRTIMER_MODE_ABS); | 624 | hrtimer_start(&q->delay_timer, time, HRTIMER_MODE_ABS); |
625 | } | 625 | } |
626 | 626 | ||