aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_gred.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/sch_gred.c')
-rw-r--r--net/sched/sch_gred.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c
index 646dbdc4ef29..29869a077480 100644
--- a/net/sched/sch_gred.c
+++ b/net/sched/sch_gred.c
@@ -89,7 +89,6 @@ struct gred_sched
89 unsigned long flags; 89 unsigned long flags;
90 u32 DPs; 90 u32 DPs;
91 u32 def; 91 u32 def;
92 u8 initd;
93}; 92};
94 93
95static inline int gred_wred_mode(struct gred_sched *table) 94static inline int gred_wred_mode(struct gred_sched *table)
@@ -166,14 +165,7 @@ gred_enqueue(struct sk_buff *skb, struct Qdisc* sch)
166 struct gred_sched *t= qdisc_priv(sch); 165 struct gred_sched *t= qdisc_priv(sch);
167 unsigned long qavg = 0; 166 unsigned long qavg = 0;
168 int i=0; 167 int i=0;
169 u16 dp; 168 u16 dp = tc_index_to_dp(skb);
170
171 if (!t->initd && skb_queue_len(&sch->q) < (sch->dev->tx_queue_len ? : 1)) {
172 D2PRINTK("NO GRED Queues setup yet! Enqueued anyway\n");
173 goto do_enqueue;
174 }
175
176 dp = tc_index_to_dp(skb);
177 169
178 if (dp >= t->DPs || (q = t->tab[dp]) == NULL) { 170 if (dp >= t->DPs || (q = t->tab[dp]) == NULL) {
179 dp = t->def; 171 dp = t->def;
@@ -241,7 +233,6 @@ gred_enqueue(struct sk_buff *skb, struct Qdisc* sch)
241 233
242 if (q->backlog + skb->len <= q->limit) { 234 if (q->backlog + skb->len <= q->limit) {
243 q->backlog += skb->len; 235 q->backlog += skb->len;
244do_enqueue:
245 return qdisc_enqueue_tail(skb, sch); 236 return qdisc_enqueue_tail(skb, sch);
246 } 237 }
247 238
@@ -420,8 +411,6 @@ static inline int gred_change_table_def(struct Qdisc *sch, struct rtattr *dps)
420 } 411 }
421 } 412 }
422 413
423 table->initd = 0;
424
425 return 0; 414 return 0;
426} 415}
427 416
@@ -509,8 +498,6 @@ static int gred_change(struct Qdisc *sch, struct rtattr *opt)
509 goto errout_locked; 498 goto errout_locked;
510 } 499 }
511 500
512 table->initd = 1;
513
514 if (gred_rio_mode(table)) { 501 if (gred_rio_mode(table)) {
515 gred_disable_wred_mode(table); 502 gred_disable_wred_mode(table);
516 if (gred_wred_mode_check(sch)) 503 if (gred_wred_mode_check(sch))