@@ -973,10 +973,13 @@ static void qfq_update_eligible(struct qfq_sched *q)
973
973
}
974
974
975
975
/* 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 )
978
978
{
979
- qdisc_dequeue_peeked (cl -> qdisc );
979
+ struct sk_buff * skb = qdisc_dequeue_peeked (cl -> qdisc );
980
+
981
+ if (!skb )
982
+ return NULL ;
980
983
981
984
cl -> deficit -= (int ) len ;
982
985
@@ -986,6 +989,8 @@ static void agg_dequeue(struct qfq_aggregate *agg,
986
989
cl -> deficit += agg -> lmax ;
987
990
list_move_tail (& cl -> alist , & agg -> active );
988
991
}
992
+
993
+ return skb ;
989
994
}
990
995
991
996
static inline struct sk_buff * qfq_peek_skb (struct qfq_aggregate * agg ,
@@ -1131,11 +1136,18 @@ static struct sk_buff *qfq_dequeue(struct Qdisc *sch)
1131
1136
if (!skb )
1132
1137
return NULL ;
1133
1138
1134
- qdisc_qstats_backlog_dec (sch , skb );
1135
1139
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 );
1136
1149
qdisc_bstats_update (sch , skb );
1137
1150
1138
- agg_dequeue (in_serv_agg , cl , len );
1139
1151
/* If lmax is lowered, through qfq_change_class, for a class
1140
1152
* owning pending packets with larger size than the new value
1141
1153
* of lmax, then the following condition may hold.
0 commit comments