diff options
Diffstat (limited to 'net/sched/sch_cbq.c')
-rw-r--r-- | net/sched/sch_cbq.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index 23a167670fd5..149b0405c5ec 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c | |||
@@ -128,7 +128,7 @@ struct cbq_class | |||
128 | long avgidle; | 128 | long avgidle; |
129 | long deficit; /* Saved deficit for WRR */ | 129 | long deficit; /* Saved deficit for WRR */ |
130 | psched_time_t penalized; | 130 | psched_time_t penalized; |
131 | struct gnet_stats_basic bstats; | 131 | struct gnet_stats_basic_packed bstats; |
132 | struct gnet_stats_queue qstats; | 132 | struct gnet_stats_queue qstats; |
133 | struct gnet_stats_rate_est rate_est; | 133 | struct gnet_stats_rate_est rate_est; |
134 | struct tc_cbq_xstats xstats; | 134 | struct tc_cbq_xstats xstats; |
@@ -163,7 +163,7 @@ struct cbq_sched_data | |||
163 | psched_time_t now_rt; /* Cached real time */ | 163 | psched_time_t now_rt; /* Cached real time */ |
164 | unsigned pmask; | 164 | unsigned pmask; |
165 | 165 | ||
166 | struct hrtimer delay_timer; | 166 | struct tasklet_hrtimer delay_timer; |
167 | struct qdisc_watchdog watchdog; /* Watchdog timer, | 167 | struct qdisc_watchdog watchdog; /* Watchdog timer, |
168 | started when CBQ has | 168 | started when CBQ has |
169 | backlog, but cannot | 169 | backlog, but cannot |
@@ -503,6 +503,8 @@ static void cbq_ovl_delay(struct cbq_class *cl) | |||
503 | cl->undertime = q->now + delay; | 503 | cl->undertime = q->now + delay; |
504 | 504 | ||
505 | if (delay > 0) { | 505 | if (delay > 0) { |
506 | struct hrtimer *ht; | ||
507 | |||
506 | sched += delay + cl->penalty; | 508 | sched += delay + cl->penalty; |
507 | cl->penalized = sched; | 509 | cl->penalized = sched; |
508 | cl->cpriority = TC_CBQ_MAXPRIO; | 510 | cl->cpriority = TC_CBQ_MAXPRIO; |
@@ -510,12 +512,12 @@ static void cbq_ovl_delay(struct cbq_class *cl) | |||
510 | 512 | ||
511 | expires = ktime_set(0, 0); | 513 | expires = ktime_set(0, 0); |
512 | expires = ktime_add_ns(expires, PSCHED_TICKS2NS(sched)); | 514 | expires = ktime_add_ns(expires, PSCHED_TICKS2NS(sched)); |
513 | if (hrtimer_try_to_cancel(&q->delay_timer) && | 515 | ht = &q->delay_timer.timer; |
514 | ktime_to_ns(ktime_sub( | 516 | if (hrtimer_try_to_cancel(ht) && |
515 | hrtimer_get_expires(&q->delay_timer), | 517 | ktime_to_ns(ktime_sub(hrtimer_get_expires(ht), |
516 | expires)) > 0) | 518 | expires)) > 0) |
517 | hrtimer_set_expires(&q->delay_timer, expires); | 519 | hrtimer_set_expires(ht, expires); |
518 | hrtimer_restart(&q->delay_timer); | 520 | hrtimer_restart(ht); |
519 | cl->delayed = 1; | 521 | cl->delayed = 1; |
520 | cl->xstats.overactions++; | 522 | cl->xstats.overactions++; |
521 | return; | 523 | return; |
@@ -591,7 +593,7 @@ static psched_tdiff_t cbq_undelay_prio(struct cbq_sched_data *q, int prio, | |||
591 | static enum hrtimer_restart cbq_undelay(struct hrtimer *timer) | 593 | static enum hrtimer_restart cbq_undelay(struct hrtimer *timer) |
592 | { | 594 | { |
593 | struct cbq_sched_data *q = container_of(timer, struct cbq_sched_data, | 595 | struct cbq_sched_data *q = container_of(timer, struct cbq_sched_data, |
594 | delay_timer); | 596 | delay_timer.timer); |
595 | struct Qdisc *sch = q->watchdog.qdisc; | 597 | struct Qdisc *sch = q->watchdog.qdisc; |
596 | psched_time_t now; | 598 | psched_time_t now; |
597 | psched_tdiff_t delay = 0; | 599 | psched_tdiff_t delay = 0; |
@@ -621,7 +623,7 @@ static enum hrtimer_restart cbq_undelay(struct hrtimer *timer) | |||
621 | 623 | ||
622 | time = ktime_set(0, 0); | 624 | time = ktime_set(0, 0); |
623 | time = ktime_add_ns(time, PSCHED_TICKS2NS(now + delay)); | 625 | time = ktime_add_ns(time, PSCHED_TICKS2NS(now + delay)); |
624 | hrtimer_start(&q->delay_timer, time, HRTIMER_MODE_ABS); | 626 | tasklet_hrtimer_start(&q->delay_timer, time, HRTIMER_MODE_ABS); |
625 | } | 627 | } |
626 | 628 | ||
627 | sch->flags &= ~TCQ_F_THROTTLED; | 629 | sch->flags &= ~TCQ_F_THROTTLED; |
@@ -1214,7 +1216,7 @@ cbq_reset(struct Qdisc* sch) | |||
1214 | q->tx_class = NULL; | 1216 | q->tx_class = NULL; |
1215 | q->tx_borrowed = NULL; | 1217 | q->tx_borrowed = NULL; |
1216 | qdisc_watchdog_cancel(&q->watchdog); | 1218 | qdisc_watchdog_cancel(&q->watchdog); |
1217 | hrtimer_cancel(&q->delay_timer); | 1219 | tasklet_hrtimer_cancel(&q->delay_timer); |
1218 | q->toplevel = TC_CBQ_MAXLEVEL; | 1220 | q->toplevel = TC_CBQ_MAXLEVEL; |
1219 | q->now = psched_get_time(); | 1221 | q->now = psched_get_time(); |
1220 | q->now_rt = q->now; | 1222 | q->now_rt = q->now; |
@@ -1397,7 +1399,8 @@ static int cbq_init(struct Qdisc *sch, struct nlattr *opt) | |||
1397 | q->link.minidle = -0x7FFFFFFF; | 1399 | q->link.minidle = -0x7FFFFFFF; |
1398 | 1400 | ||
1399 | qdisc_watchdog_init(&q->watchdog, sch); | 1401 | qdisc_watchdog_init(&q->watchdog, sch); |
1400 | hrtimer_init(&q->delay_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); | 1402 | tasklet_hrtimer_init(&q->delay_timer, cbq_undelay, |
1403 | CLOCK_MONOTONIC, HRTIMER_MODE_ABS); | ||
1401 | q->delay_timer.function = cbq_undelay; | 1404 | q->delay_timer.function = cbq_undelay; |
1402 | q->toplevel = TC_CBQ_MAXLEVEL; | 1405 | q->toplevel = TC_CBQ_MAXLEVEL; |
1403 | q->now = psched_get_time(); | 1406 | q->now = psched_get_time(); |