@@ -829,28 +829,6 @@ update_vf(struct hfsc_class *cl, unsigned int len, u64 cur_time)
829
829
}
830
830
}
831
831
832
- static void
833
- set_active (struct hfsc_class * cl , unsigned int len )
834
- {
835
- if (cl -> cl_flags & HFSC_RSC )
836
- init_ed (cl , len );
837
- if (cl -> cl_flags & HFSC_FSC )
838
- init_vf (cl , len );
839
-
840
- }
841
-
842
- static void
843
- set_passive (struct hfsc_class * cl )
844
- {
845
- if (cl -> cl_flags & HFSC_RSC )
846
- eltree_remove (cl );
847
-
848
- /*
849
- * vttree is now handled in update_vf() so that update_vf(cl, 0, 0)
850
- * needs to be called explicitly to remove a class from vttree.
851
- */
852
- }
853
-
854
832
static unsigned int
855
833
qdisc_peek_len (struct Qdisc * sch )
856
834
{
@@ -1221,8 +1199,12 @@ hfsc_qlen_notify(struct Qdisc *sch, unsigned long arg)
1221
1199
{
1222
1200
struct hfsc_class * cl = (struct hfsc_class * )arg ;
1223
1201
1202
+ /* vttree is now handled in update_vf() so that update_vf(cl, 0, 0)
1203
+ * needs to be called explicitly to remove a class from vttree.
1204
+ */
1224
1205
update_vf (cl , 0 , 0 );
1225
- set_passive (cl );
1206
+ if (cl -> cl_flags & HFSC_RSC )
1207
+ eltree_remove (cl );
1226
1208
}
1227
1209
1228
1210
static unsigned long
@@ -1583,7 +1565,12 @@ hfsc_enqueue(struct sk_buff *skb, struct Qdisc *sch, struct sk_buff **to_free)
1583
1565
}
1584
1566
1585
1567
if (cl -> qdisc -> q .qlen == 1 ) {
1586
- set_active (cl , qdisc_pkt_len (skb ));
1568
+ unsigned int len = qdisc_pkt_len (skb );
1569
+
1570
+ if (cl -> cl_flags & HFSC_RSC )
1571
+ init_ed (cl , len );
1572
+ if (cl -> cl_flags & HFSC_FSC )
1573
+ init_vf (cl , len );
1587
1574
/*
1588
1575
* If this is the first packet, isolate the head so an eventual
1589
1576
* head drop before the first dequeue operation has no chance
@@ -1647,18 +1634,18 @@ hfsc_dequeue(struct Qdisc *sch)
1647
1634
if (realtime )
1648
1635
cl -> cl_cumul += qdisc_pkt_len (skb );
1649
1636
1650
- if (cl -> qdisc -> q . qlen != 0 ) {
1651
- if (cl -> cl_flags & HFSC_RSC ) {
1637
+ if (cl -> cl_flags & HFSC_RSC ) {
1638
+ if (cl -> qdisc -> q . qlen != 0 ) {
1652
1639
/* update ed */
1653
1640
next_len = qdisc_peek_len (cl -> qdisc );
1654
1641
if (realtime )
1655
1642
update_ed (cl , next_len );
1656
1643
else
1657
1644
update_d (cl , next_len );
1645
+ } else {
1646
+ /* the class becomes passive */
1647
+ eltree_remove (cl );
1658
1648
}
1659
- } else {
1660
- /* the class becomes passive */
1661
- set_passive (cl );
1662
1649
}
1663
1650
1664
1651
qdisc_bstats_update (sch , skb );
0 commit comments