unsigned long flags;
u32 DPs;
u32 def;
+ struct red_parms wred_set;
};
static inline int gred_wred_mode(struct gred_sched *table)
return skb->tc_index & GRED_VQ_MASK;
}
+static inline void gred_load_wred_set(struct gred_sched *table,
+ struct gred_sched_data *q)
+{
+ q->parms.qavg = table->wred_set.qavg;
+ q->parms.qidlestart = table->wred_set.qidlestart;
+}
+
+static inline void gred_store_wred_set(struct gred_sched *table,
+ struct gred_sched_data *q)
+{
+ table->wred_set.qavg = q->parms.qavg;
+}
+
static int
gred_enqueue(struct sk_buff *skb, struct Qdisc* sch)
{
if (gred_wred_mode(t)) {
qavg = 0;
- q->parms.qavg = t->tab[t->def]->parms.qavg;
- q->parms.qidlestart = t->tab[t->def]->parms.qidlestart;
+ gred_load_wred_set(t, q);
}
q->parms.qavg = red_calc_qavg(&q->parms, gred_backlog(t, q, sch));
red_end_of_idle_period(&q->parms);
if (gred_wred_mode(t))
- t->tab[t->def]->parms.qavg = q->parms.qavg;
+ gred_store_wred_set(t, q);
switch (red_action(&q->parms, q->parms.qavg + qavg)) {
case RED_DONT_MARK:
return skb;
}
- if (gred_wred_mode(t)) {
- q= t->tab[t->def];
- if (!q)
- D2PRINTK("no default VQ set: Results will be "
- "screwed up\n");
- else
- red_start_of_idle_period(&q->parms);
- }
+ if (gred_wred_mode(t))
+ red_start_of_idle_period(&t->wred_set);
return NULL;
}
return len;
}
- q=t->tab[t->def];
- if (!q) {
- D2PRINTK("no default VQ set: Results might be screwed up\n");
- return 0;
- }
+ if (gred_wred_mode(t))
+ red_start_of_idle_period(&t->wred_set);
- red_start_of_idle_period(&q->parms);
return 0;
}