Skip to content

Commit 348e343

Browse files
Phil Sutterdavem330
authored andcommitted
net: sched: drop all special handling of tx_queue_len == 0
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 <[email protected]> Cc: Jamal Hadi Salim <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 906470c commit 348e343

File tree

5 files changed

+9
-17
lines changed

5 files changed

+9
-17
lines changed

net/sched/sch_fifo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static int fifo_init(struct Qdisc *sch, struct nlattr *opt)
5454
bool is_bfifo = sch->ops == &bfifo_qdisc_ops;
5555

5656
if (opt == NULL) {
57-
u32 limit = qdisc_dev(sch)->tx_queue_len ? : 1;
57+
u32 limit = qdisc_dev(sch)->tx_queue_len;
5858

5959
if (is_bfifo)
6060
limit *= psched_mtu(qdisc_dev(sch));

net/sched/sch_gred.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -512,11 +512,9 @@ static int gred_init(struct Qdisc *sch, struct nlattr *opt)
512512

513513
if (tb[TCA_GRED_LIMIT])
514514
sch->limit = nla_get_u32(tb[TCA_GRED_LIMIT]);
515-
else {
516-
u32 qlen = qdisc_dev(sch)->tx_queue_len ? : 1;
517-
518-
sch->limit = qlen * psched_mtu(qdisc_dev(sch));
519-
}
515+
else
516+
sch->limit = qdisc_dev(sch)->tx_queue_len
517+
* psched_mtu(qdisc_dev(sch));
520518

521519
return gred_change_table_def(sch, tb[TCA_GRED_DPS]);
522520
}

net/sched/sch_htb.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,11 +1048,9 @@ static int htb_init(struct Qdisc *sch, struct nlattr *opt)
10481048

10491049
if (tb[TCA_HTB_DIRECT_QLEN])
10501050
q->direct_qlen = nla_get_u32(tb[TCA_HTB_DIRECT_QLEN]);
1051-
else {
1051+
else
10521052
q->direct_qlen = qdisc_dev(sch)->tx_queue_len;
1053-
if (q->direct_qlen < 2) /* some devices have zero tx_queue_len */
1054-
q->direct_qlen = 2;
1055-
}
1053+
10561054
if ((q->rate2quantum = gopt->rate2quantum) < 1)
10571055
q->rate2quantum = 1;
10581056
q->defcls = gopt->defcls;

net/sched/sch_plug.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,8 @@ static int plug_init(struct Qdisc *sch, struct nlattr *opt)
130130
q->unplug_indefinite = false;
131131

132132
if (opt == NULL) {
133-
/* We will set a default limit of 100 pkts (~150kB)
134-
* in case tx_queue_len is not available. The
135-
* default value is completely arbitrary.
136-
*/
137-
u32 pkt_limit = qdisc_dev(sch)->tx_queue_len ? : 100;
138-
q->limit = pkt_limit * psched_mtu(qdisc_dev(sch));
133+
q->limit = qdisc_dev(sch)->tx_queue_len
134+
* psched_mtu(qdisc_dev(sch));
139135
} else {
140136
struct tc_plug_qopt *ctl = nla_data(opt);
141137

net/sched/sch_sfb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ static int sfb_change(struct Qdisc *sch, struct nlattr *opt)
502502

503503
limit = ctl->limit;
504504
if (limit == 0)
505-
limit = max_t(u32, qdisc_dev(sch)->tx_queue_len, 1);
505+
limit = qdisc_dev(sch)->tx_queue_len;
506506

507507
child = fifo_create_dflt(sch, &pfifo_qdisc_ops, limit);
508508
if (IS_ERR(child))

0 commit comments

Comments
 (0)