mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-12 08:00:09 +00:00
[PKT_SCHED]: GRED: Remove initd flag
The case when the default VQ is not set up yet is already handled in a less error prone way. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
parent
18e3fb84e6
commit
4a591834cf
@ -89,7 +89,6 @@ struct gred_sched
|
|||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
u32 DPs;
|
u32 DPs;
|
||||||
u32 def;
|
u32 def;
|
||||||
u8 initd;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline int gred_wred_mode(struct gred_sched *table)
|
static inline int gred_wred_mode(struct gred_sched *table)
|
||||||
@ -166,14 +165,7 @@ gred_enqueue(struct sk_buff *skb, struct Qdisc* sch)
|
|||||||
struct gred_sched *t= qdisc_priv(sch);
|
struct gred_sched *t= qdisc_priv(sch);
|
||||||
unsigned long qavg = 0;
|
unsigned long qavg = 0;
|
||||||
int i=0;
|
int i=0;
|
||||||
u16 dp;
|
u16 dp = tc_index_to_dp(skb);
|
||||||
|
|
||||||
if (!t->initd && skb_queue_len(&sch->q) < (sch->dev->tx_queue_len ? : 1)) {
|
|
||||||
D2PRINTK("NO GRED Queues setup yet! Enqueued anyway\n");
|
|
||||||
goto do_enqueue;
|
|
||||||
}
|
|
||||||
|
|
||||||
dp = tc_index_to_dp(skb);
|
|
||||||
|
|
||||||
if (dp >= t->DPs || (q = t->tab[dp]) == NULL) {
|
if (dp >= t->DPs || (q = t->tab[dp]) == NULL) {
|
||||||
dp = t->def;
|
dp = t->def;
|
||||||
@ -241,7 +233,6 @@ gred_enqueue(struct sk_buff *skb, struct Qdisc* sch)
|
|||||||
|
|
||||||
if (q->backlog + skb->len <= q->limit) {
|
if (q->backlog + skb->len <= q->limit) {
|
||||||
q->backlog += skb->len;
|
q->backlog += skb->len;
|
||||||
do_enqueue:
|
|
||||||
return qdisc_enqueue_tail(skb, sch);
|
return qdisc_enqueue_tail(skb, sch);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -420,8 +411,6 @@ static inline int gred_change_table_def(struct Qdisc *sch, struct rtattr *dps)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
table->initd = 0;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -509,8 +498,6 @@ static int gred_change(struct Qdisc *sch, struct rtattr *opt)
|
|||||||
goto errout_locked;
|
goto errout_locked;
|
||||||
}
|
}
|
||||||
|
|
||||||
table->initd = 1;
|
|
||||||
|
|
||||||
if (gred_rio_mode(table)) {
|
if (gred_rio_mode(table)) {
|
||||||
gred_disable_wred_mode(table);
|
gred_disable_wred_mode(table);
|
||||||
if (gred_wred_mode_check(sch))
|
if (gred_wred_mode_check(sch))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user