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