mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-14 09:47:20 +00:00
[NET_SCHED]: sch_cbq: use hrtimer based watchdog
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
59cb5c6734
commit
88a993540a
@ -181,11 +181,11 @@ struct cbq_sched_data
|
|||||||
unsigned pmask;
|
unsigned pmask;
|
||||||
|
|
||||||
struct timer_list delay_timer;
|
struct timer_list delay_timer;
|
||||||
struct timer_list wd_timer; /* Watchdog timer,
|
struct qdisc_watchdog watchdog; /* Watchdog timer,
|
||||||
started when CBQ has
|
started when CBQ has
|
||||||
backlog, but cannot
|
backlog, but cannot
|
||||||
transmit just now */
|
transmit just now */
|
||||||
long wd_expires;
|
psched_tdiff_t wd_expires;
|
||||||
int toplevel;
|
int toplevel;
|
||||||
u32 hgenerator;
|
u32 hgenerator;
|
||||||
};
|
};
|
||||||
@ -604,14 +604,6 @@ static void cbq_ovl_drop(struct cbq_class *cl)
|
|||||||
cbq_ovl_classic(cl);
|
cbq_ovl_classic(cl);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cbq_watchdog(unsigned long arg)
|
|
||||||
{
|
|
||||||
struct Qdisc *sch = (struct Qdisc*)arg;
|
|
||||||
|
|
||||||
sch->flags &= ~TCQ_F_THROTTLED;
|
|
||||||
netif_schedule(sch->dev);
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned long cbq_undelay_prio(struct cbq_sched_data *q, int prio)
|
static unsigned long cbq_undelay_prio(struct cbq_sched_data *q, int prio)
|
||||||
{
|
{
|
||||||
struct cbq_class *cl;
|
struct cbq_class *cl;
|
||||||
@ -1063,13 +1055,9 @@ cbq_dequeue(struct Qdisc *sch)
|
|||||||
|
|
||||||
if (sch->q.qlen) {
|
if (sch->q.qlen) {
|
||||||
sch->qstats.overlimits++;
|
sch->qstats.overlimits++;
|
||||||
if (q->wd_expires) {
|
if (q->wd_expires)
|
||||||
long delay = PSCHED_US2JIFFIE(q->wd_expires);
|
qdisc_watchdog_schedule(&q->watchdog,
|
||||||
if (delay <= 0)
|
q->now + q->wd_expires);
|
||||||
delay = 1;
|
|
||||||
mod_timer(&q->wd_timer, jiffies + delay);
|
|
||||||
sch->flags |= TCQ_F_THROTTLED;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -1276,7 +1264,7 @@ cbq_reset(struct Qdisc* sch)
|
|||||||
q->pmask = 0;
|
q->pmask = 0;
|
||||||
q->tx_class = NULL;
|
q->tx_class = NULL;
|
||||||
q->tx_borrowed = NULL;
|
q->tx_borrowed = NULL;
|
||||||
del_timer(&q->wd_timer);
|
qdisc_watchdog_cancel(&q->watchdog);
|
||||||
del_timer(&q->delay_timer);
|
del_timer(&q->delay_timer);
|
||||||
q->toplevel = TC_CBQ_MAXLEVEL;
|
q->toplevel = TC_CBQ_MAXLEVEL;
|
||||||
PSCHED_GET_TIME(q->now);
|
PSCHED_GET_TIME(q->now);
|
||||||
@ -1446,9 +1434,7 @@ static int cbq_init(struct Qdisc *sch, struct rtattr *opt)
|
|||||||
q->link.minidle = -0x7FFFFFFF;
|
q->link.minidle = -0x7FFFFFFF;
|
||||||
q->link.stats_lock = &sch->dev->queue_lock;
|
q->link.stats_lock = &sch->dev->queue_lock;
|
||||||
|
|
||||||
init_timer(&q->wd_timer);
|
qdisc_watchdog_init(&q->watchdog, sch);
|
||||||
q->wd_timer.data = (unsigned long)sch;
|
|
||||||
q->wd_timer.function = cbq_watchdog;
|
|
||||||
init_timer(&q->delay_timer);
|
init_timer(&q->delay_timer);
|
||||||
q->delay_timer.data = (unsigned long)sch;
|
q->delay_timer.data = (unsigned long)sch;
|
||||||
q->delay_timer.function = cbq_undelay;
|
q->delay_timer.function = cbq_undelay;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user