if (!t->eqp && t->grio) { 
if (!gred_wred_mode(t) && t->grio) { 
gred_enqueue(struct sk_buff *skb, struct Qdisc* sch){	psched_time_t now;	struct gred_sched_data *q=NULL;	struct gred_sched *t= qdisc_priv(sch);	unsigned long	qave=0;		int i=0;	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;	}	if ( ((skb->tc_index&0xf) > (t->DPs -1)) || !(q=t->tab[skb->tc_index&0xf])) {		printk("GRED: setting to default (%d)\n ",t->def);		if (!(q=t->tab[t->def])) {			DPRINTK("GRED: setting to default FAILED! dropping!! "			    "(%d)\n ", t->def);			goto drop;		}		/* fix tc_index? --could be controvesial but needed for		   requeueing */		skb->tc_index=(skb->tc_index&0xfffffff0) | t->def;	}	D2PRINTK("gred_enqueue virtualQ 0x%x classid %x backlog %d "	    "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 (!t->eqp && t->grio) {		for (i=0;i<t->DPs;i++) {			if ((!t->tab[i]) || (i==q->DP))					continue; 							if ((t->tab[i]->prio < q->prio) && (PSCHED_IS_PASTPERFECT(t->tab[i]->qidlestart)))				qave +=t->tab[i]->qave;		}				}	q->packetsin++;	q->bytesin+=skb->len;	if (t->eqp && t->grio) {		qave=0;		q->qave=t->tab[t->def]->qave;		q->qidlestart=t->tab[t->def]->qidlestart;	}	if (!PSCHED_IS_PASTPERFECT(q->qidlestart)) {		long us_idle;		PSCHED_GET_TIME(now);		us_idle = PSCHED_TDIFF_SAFE(now, q->qidlestart, q->Scell_max);		PSCHED_SET_PASTPERFECT(q->qidlestart);		q->qave >>= q->Stab[(us_idle>>q->Scell_log)&0xFF];	} else {		if (t->eqp) {			q->qave += sch->qstats.backlog - (q->qave >> q->Wlog);		} else {			q->qave += q->backlog - (q->qave >> q->Wlog);		}	}		if (t->eqp && t->grio) 		t->tab[t->def]->qave=q->qave;	if ((q->qave+qave) < q->qth_min) {		q->qcount = -1;enqueue:		if (q->backlog + skb->len <= q->limit) {			q->backlog += skb->len;do_enqueue:			__skb_queue_tail(&sch->q, skb);			sch->qstats.backlog += skb->len;			sch->bstats.bytes += skb->len;			sch->bstats.packets++;			return 0;		} else {			q->pdrop++;		}drop:		kfree_skb(skb);		sch->qstats.drops++;		return NET_XMIT_DROP;	}	if ((q->qave+qave) >= q->qth_max) {		q->qcount = -1;		sch->qstats.overlimits++;		q->forced++;		goto drop;	}	if (++q->qcount) {		if ((((qave+q->qave) - q->qth_min)>>q->Wlog)*q->qcount < q->qR)			goto enqueue;		q->qcount = 0;		q->qR = net_random()&q->Rmask;		sch->qstats.overlimits++;		q->early++;		goto drop;	}	q->qR = net_random()&q->Rmask;	goto enqueue;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/dea3f62852f98670b72ad355c67bd55c9af58530/sch_gred.c/buggy/net/sched/sch_gred.c