@@ -74,6 +74,11 @@ static const struct nla_policy ets_class_policy[TCA_ETS_MAX + 1] = {
7474 [TCA_ETS_QUANTA_BAND ] = { .type = NLA_U32 },
7575};
7676
77+ static bool cl_is_active (struct ets_class * cl )
78+ {
79+ return !list_empty (& cl -> alist );
80+ }
81+
7782static int ets_quantum_parse (struct Qdisc * sch , const struct nlattr * attr ,
7883 unsigned int * quantum ,
7984 struct netlink_ext_ack * extack )
@@ -421,7 +426,6 @@ static int ets_qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch,
421426 struct ets_sched * q = qdisc_priv (sch );
422427 struct ets_class * cl ;
423428 int err = 0 ;
424- bool first ;
425429
426430 cl = ets_classify (skb , sch , & err );
427431 if (!cl ) {
@@ -431,7 +435,6 @@ static int ets_qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch,
431435 return err ;
432436 }
433437
434- first = !cl -> qdisc -> q .qlen ;
435438 err = qdisc_enqueue (skb , cl -> qdisc , to_free );
436439 if (unlikely (err != NET_XMIT_SUCCESS )) {
437440 if (net_xmit_drop_count (err )) {
@@ -441,7 +444,7 @@ static int ets_qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch,
441444 return err ;
442445 }
443446
444- if (first && !ets_class_is_strict (q , cl )) {
447+ if (! cl_is_active ( cl ) && !ets_class_is_strict (q , cl )) {
445448 list_add_tail (& cl -> alist , & q -> active );
446449 cl -> deficit = cl -> quantum ;
447450 }
0 commit comments