net: sched: drop all special handling of tx_queue_len == 0
authorPhil Sutter <phil@nwl.cc>
Tue, 18 Aug 2015 08:30:49 +0000 (10:30 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Aug 2015 18:55:08 +0000 (11:55 -0700)
Those were all workarounds for the formerly double meaning of
tx_queue_len, which broke scheduling algorithms if untreated.

Now that all in-tree drivers have been converted away from setting
tx_queue_len = 0, it should be safe to drop these workarounds for
categorically broken setups.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_fifo.c
net/sched/sch_gred.c
net/sched/sch_htb.c
net/sched/sch_plug.c
net/sched/sch_sfb.c

index 2e2398cfc694aaf7ed12c2afda377e8ded340cb2..2177eac0a61ed00c6c60655f577e0dd816fd2c08 100644 (file)
@@ -54,7 +54,7 @@ static int fifo_init(struct Qdisc *sch, struct nlattr *opt)
        bool is_bfifo = sch->ops == &bfifo_qdisc_ops;
 
        if (opt == NULL) {
-               u32 limit = qdisc_dev(sch)->tx_queue_len ? : 1;
+               u32 limit = qdisc_dev(sch)->tx_queue_len;
 
                if (is_bfifo)
                        limit *= psched_mtu(qdisc_dev(sch));
index abb9f2fec28fbd435ff89a17eb7e1937cb4c19b3..80105109f756315d7a31d6734887941c9f16ea9c 100644 (file)
@@ -512,11 +512,9 @@ static int gred_init(struct Qdisc *sch, struct nlattr *opt)
 
        if (tb[TCA_GRED_LIMIT])
                sch->limit = nla_get_u32(tb[TCA_GRED_LIMIT]);
-       else {
-               u32 qlen = qdisc_dev(sch)->tx_queue_len ? : 1;
-
-               sch->limit = qlen * psched_mtu(qdisc_dev(sch));
-       }
+       else
+               sch->limit = qdisc_dev(sch)->tx_queue_len
+                            * psched_mtu(qdisc_dev(sch));
 
        return gred_change_table_def(sch, tb[TCA_GRED_DPS]);
 }
index f1acb0f60dc35b724289f98498b5cf2162583ce9..cf4b0f865d1bc6a87873b54bb89cfe8e28f36ea6 100644 (file)
@@ -1048,11 +1048,9 @@ static int htb_init(struct Qdisc *sch, struct nlattr *opt)
 
        if (tb[TCA_HTB_DIRECT_QLEN])
                q->direct_qlen = nla_get_u32(tb[TCA_HTB_DIRECT_QLEN]);
-       else {
+       else
                q->direct_qlen = qdisc_dev(sch)->tx_queue_len;
-               if (q->direct_qlen < 2) /* some devices have zero tx_queue_len */
-                       q->direct_qlen = 2;
-       }
+
        if ((q->rate2quantum = gopt->rate2quantum) < 1)
                q->rate2quantum = 1;
        q->defcls = gopt->defcls;
index ade9445a55abe468107f2bcb233e48da027afb4b..5abfe44678d4a1ecda495bf9e00879c649c63cdb 100644 (file)
@@ -130,12 +130,8 @@ static int plug_init(struct Qdisc *sch, struct nlattr *opt)
        q->unplug_indefinite = false;
 
        if (opt == NULL) {
-               /* We will set a default limit of 100 pkts (~150kB)
-                * in case tx_queue_len is not available. The
-                * default value is completely arbitrary.
-                */
-               u32 pkt_limit = qdisc_dev(sch)->tx_queue_len ? : 100;
-               q->limit = pkt_limit * psched_mtu(qdisc_dev(sch));
+               q->limit = qdisc_dev(sch)->tx_queue_len
+                          * psched_mtu(qdisc_dev(sch));
        } else {
                struct tc_plug_qopt *ctl = nla_data(opt);
 
index 4b815193326c9abae464c05d53609c28c2071b38..dcdff5c769a1c28e6ea476ce822c8fbe74f9fc53 100644 (file)
@@ -502,7 +502,7 @@ static int sfb_change(struct Qdisc *sch, struct nlattr *opt)
 
        limit = ctl->limit;
        if (limit == 0)
-               limit = max_t(u32, qdisc_dev(sch)->tx_queue_len, 1);
+               limit = qdisc_dev(sch)->tx_queue_len;
 
        child = fifo_create_dflt(sch, &pfifo_qdisc_ops, limit);
        if (IS_ERR(child))
This page took 0.03615 seconds and 5 git commands to generate.