@@ -970,10 +970,13 @@ static void qfq_update_eligible(struct qfq_sched *q)
970970}
971971
972972/* Dequeue head packet of the head class in the DRR queue of the aggregate. */
973- static void agg_dequeue (struct qfq_aggregate * agg ,
974- struct qfq_class * cl , unsigned int len )
973+ static struct sk_buff * agg_dequeue (struct qfq_aggregate * agg ,
974+ struct qfq_class * cl , unsigned int len )
975975{
976- qdisc_dequeue_peeked (cl -> qdisc );
976+ struct sk_buff * skb = qdisc_dequeue_peeked (cl -> qdisc );
977+
978+ if (!skb )
979+ return NULL ;
977980
978981 cl -> deficit -= (int ) len ;
979982
@@ -983,6 +986,8 @@ static void agg_dequeue(struct qfq_aggregate *agg,
983986 cl -> deficit += agg -> lmax ;
984987 list_move_tail (& cl -> alist , & agg -> active );
985988 }
989+
990+ return skb ;
986991}
987992
988993static inline struct sk_buff * qfq_peek_skb (struct qfq_aggregate * agg ,
@@ -1128,11 +1133,18 @@ static struct sk_buff *qfq_dequeue(struct Qdisc *sch)
11281133 if (!skb )
11291134 return NULL ;
11301135
1131- qdisc_qstats_backlog_dec (sch , skb );
11321136 sch -> q .qlen -- ;
1137+
1138+ skb = agg_dequeue (in_serv_agg , cl , len );
1139+
1140+ if (!skb ) {
1141+ sch -> q .qlen ++ ;
1142+ return NULL ;
1143+ }
1144+
1145+ qdisc_qstats_backlog_dec (sch , skb );
11331146 qdisc_bstats_update (sch , skb );
11341147
1135- agg_dequeue (in_serv_agg , cl , len );
11361148 /* If lmax is lowered, through qfq_change_class, for a class
11371149 * owning pending packets with larger size than the new value
11381150 * of lmax, then the following condition may hold.
0 commit comments