@@ -973,10 +973,13 @@ static void qfq_update_eligible(struct qfq_sched *q)
973973}
974974
975975/* Dequeue head packet of the head class in the DRR queue of the aggregate. */ 
976- static  void   agg_dequeue (struct  qfq_aggregate  * agg ,
977- 			struct  qfq_class  * cl , unsigned int   len )
976+ static  struct   sk_buff   * agg_dequeue (struct  qfq_aggregate  * agg ,
977+ 				    struct  qfq_class  * cl , unsigned int   len )
978978{
979- 	qdisc_dequeue_peeked (cl -> qdisc );
979+ 	struct  sk_buff  * skb  =  qdisc_dequeue_peeked (cl -> qdisc );
980+ 
981+ 	if  (!skb )
982+ 		return  NULL ;
980983
981984	cl -> deficit  -=  (int ) len ;
982985
@@ -986,6 +989,8 @@ static void agg_dequeue(struct qfq_aggregate *agg,
986989		cl -> deficit  +=  agg -> lmax ;
987990		list_move_tail (& cl -> alist , & agg -> active );
988991	}
992+ 
993+ 	return  skb ;
989994}
990995
991996static  inline  struct  sk_buff  * qfq_peek_skb (struct  qfq_aggregate  * agg ,
@@ -1131,11 +1136,18 @@ static struct sk_buff *qfq_dequeue(struct Qdisc *sch)
11311136	if  (!skb )
11321137		return  NULL ;
11331138
1134- 	qdisc_qstats_backlog_dec (sch , skb );
11351139	sch -> q .qlen -- ;
1140+ 
1141+ 	skb  =  agg_dequeue (in_serv_agg , cl , len );
1142+ 
1143+ 	if  (!skb ) {
1144+ 		sch -> q .qlen ++ ;
1145+ 		return  NULL ;
1146+ 	}
1147+ 
1148+ 	qdisc_qstats_backlog_dec (sch , skb );
11361149	qdisc_bstats_update (sch , skb );
11371150
1138- 	agg_dequeue (in_serv_agg , cl , len );
11391151	/* If lmax is lowered, through qfq_change_class, for a class 
11401152	 * owning pending packets with larger size than the new value 
11411153	 * of lmax, then the following condition may hold. 
0 commit comments