@@ -974,10 +974,13 @@ static void qfq_update_eligible(struct qfq_sched *q)
974974}
975975
976976/* Dequeue head packet of the head class in the DRR queue of the aggregate. */
977- static void agg_dequeue (struct qfq_aggregate * agg ,
978- struct qfq_class * cl , unsigned int len )
977+ static struct sk_buff * agg_dequeue (struct qfq_aggregate * agg ,
978+ struct qfq_class * cl , unsigned int len )
979979{
980- qdisc_dequeue_peeked (cl -> qdisc );
980+ struct sk_buff * skb = qdisc_dequeue_peeked (cl -> qdisc );
981+
982+ if (!skb )
983+ return NULL ;
981984
982985 cl -> deficit -= (int ) len ;
983986
@@ -987,6 +990,8 @@ static void agg_dequeue(struct qfq_aggregate *agg,
987990 cl -> deficit += agg -> lmax ;
988991 list_move_tail (& cl -> alist , & agg -> active );
989992 }
993+
994+ return skb ;
990995}
991996
992997static inline struct sk_buff * qfq_peek_skb (struct qfq_aggregate * agg ,
@@ -1132,11 +1137,18 @@ static struct sk_buff *qfq_dequeue(struct Qdisc *sch)
11321137 if (!skb )
11331138 return NULL ;
11341139
1135- qdisc_qstats_backlog_dec (sch , skb );
11361140 sch -> q .qlen -- ;
1141+
1142+ skb = agg_dequeue (in_serv_agg , cl , len );
1143+
1144+ if (!skb ) {
1145+ sch -> q .qlen ++ ;
1146+ return NULL ;
1147+ }
1148+
1149+ qdisc_qstats_backlog_dec (sch , skb );
11371150 qdisc_bstats_update (sch , skb );
11381151
1139- agg_dequeue (in_serv_agg , cl , len );
11401152 /* If lmax is lowered, through qfq_change_class, for a class
11411153 * owning pending packets with larger size than the new value
11421154 * of lmax, then the following condition may hold.
0 commit comments