enum {
GRED_WRED_MODE = 1,
+ GRED_RIO_MODE,
};
struct gred_sched
u32 DPs;
u32 def;
u8 initd;
- u8 grio;
};
static inline int gred_wred_mode(struct gred_sched *table)
__clear_bit(GRED_WRED_MODE, &table->flags);
}
+static inline int gred_rio_mode(struct gred_sched *table)
+{
+ return test_bit(GRED_RIO_MODE, &table->flags);
+}
+
+static inline void gred_enable_rio_mode(struct gred_sched *table)
+{
+ __set_bit(GRED_RIO_MODE, &table->flags);
+}
+
+static inline void gred_disable_rio_mode(struct gred_sched *table)
+{
+ __clear_bit(GRED_RIO_MODE, &table->flags);
+}
+
static inline int gred_wred_mode_check(struct Qdisc *sch)
{
struct gred_sched *table = qdisc_priv(sch);
"general backlog %d\n",skb->tc_index&0xf,sch->handle,q->backlog,
sch->qstats.backlog);
/* sum up all the qaves of prios <= to ours to get the new qave*/
- if (!gred_wred_mode(t) && t->grio) {
+ if (!gred_wred_mode(t) && gred_rio_mode(t)) {
for (i=0;i<t->DPs;i++) {
if ((!t->tab[i]) || (i==q->DP))
continue;
table->def=sopt->def_DP;
if (sopt->grio) {
- table->grio = 1;
+ gred_enable_rio_mode(table);
gred_disable_wred_mode(table);
if (gred_wred_mode_check(sch))
gred_enable_wred_mode(table);
} else {
- table->grio = 0;
+ gred_disable_rio_mode(table);
gred_disable_wred_mode(table);
}
}
q= table->tab[ctl->DP];
- if (table->grio) {
+ if (gred_rio_mode(table)) {
if (ctl->prio <=0) {
if (table->def && table->tab[table->def]) {
DPRINTK("\nGRED: DP %u does not have a prio"
PSCHED_SET_PASTPERFECT(q->qidlestart);
memcpy(q->Stab, RTA_DATA(tb[TCA_GRED_STAB-1]), 256);
- if (table->grio) {
+ if (gred_rio_mode(table)) {
gred_disable_wred_mode(table);
if (gred_wred_mode_check(sch))
gred_enable_wred_mode(table);
q->qth_min = ctl->qth_min<<ctl->Wlog;
q->qth_max = ctl->qth_max<<ctl->Wlog;
- if (table->grio)
+ if (gred_rio_mode(table))
q->prio=table->tab[ctl->DP]->prio;
else
q->prio=8;
sopt = RTA_DATA(tb2[TCA_GRED_DPS-1]);
table->DPs=sopt->DPs;
table->def=sopt->def_DP;
- table->grio=sopt->grio;
+
+ if (sopt->grio)
+ gred_enable_rio_mode(table);
+ else
+ gred_disable_rio_mode(table);
+
table->initd=0;
return 0;
}