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