netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: netdev@vger.kernel.org
Cc: brouer@redhat.com, davem@davemloft.net,
	Jamal Hadi Salim <jhs@mojatatu.com>
Subject: [PATCH 21/21] net: sched: drop all special handling of tx_queue_len == 0
Date: Tue, 18 Aug 2015 10:30:49 +0200	[thread overview]
Message-ID: <1439886649-24166-22-git-send-email-phil@nwl.cc> (raw)
In-Reply-To: <1439886649-24166-21-git-send-email-phil@nwl.cc>

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>
---
 net/sched/sch_fifo.c | 2 +-
 net/sched/sch_gred.c | 8 +++-----
 net/sched/sch_htb.c  | 6 ++----
 net/sched/sch_plug.c | 8 ++------
 net/sched/sch_sfb.c  | 2 +-
 5 files changed, 9 insertions(+), 17 deletions(-)

diff --git a/net/sched/sch_fifo.c b/net/sched/sch_fifo.c
index 2e2398c..2177eac 100644
--- a/net/sched/sch_fifo.c
+++ b/net/sched/sch_fifo.c
@@ -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));
diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c
index abb9f2f..8010510 100644
--- a/net/sched/sch_gred.c
+++ b/net/sched/sch_gred.c
@@ -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]);
 }
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index f1acb0f..cf4b0f8 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -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;
diff --git a/net/sched/sch_plug.c b/net/sched/sch_plug.c
index ade9445..5abfe44 100644
--- a/net/sched/sch_plug.c
+++ b/net/sched/sch_plug.c
@@ -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);
 
diff --git a/net/sched/sch_sfb.c b/net/sched/sch_sfb.c
index 4b81519..dcdff5c 100644
--- a/net/sched/sch_sfb.c
+++ b/net/sched/sch_sfb.c
@@ -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))
-- 
2.1.2

  reply	other threads:[~2015-08-18  8:30 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-18  8:30 [PATCH 00/21] net: Convert drivers to IFF_NO_QUEUE and cleanup afterwards Phil Sutter
2015-08-18  8:30 ` [PATCH 01/21] net: veth: enable noqueue operation by default Phil Sutter
2015-08-18  8:30   ` [PATCH 02/21] net: dummy: convert to using IFF_NO_QUEUE Phil Sutter
2015-08-18  8:30     ` [PATCH 03/21] net: geneve: " Phil Sutter
2015-08-18  8:30       ` [PATCH 04/21] net: loopback: " Phil Sutter
2015-08-18  8:30         ` [PATCH 05/21] net: nlmon: " Phil Sutter
2015-08-18  8:30           ` [PATCH 06/21] net: team: " Phil Sutter
2015-08-18  8:30             ` [PATCH 07/21] net: vxlan: " Phil Sutter
2015-08-18  8:30               ` [PATCH 08/21] net: 8021q: " Phil Sutter
2015-08-18  8:30                 ` [PATCH 09/21] net: bridge: " Phil Sutter
2015-08-18  8:30                   ` [PATCH 10/21] net: 6lowpan: " Phil Sutter
2015-08-18  8:30                     ` [PATCH 11/21] net: bonding: " Phil Sutter
2015-08-18  8:30                       ` [PATCH 12/21] net: ipvlan: " Phil Sutter
2015-08-18  8:30                         ` [PATCH 13/21] net: dsa: " Phil Sutter
2015-08-18  8:30                           ` [PATCH 14/21] net: hostap: " Phil Sutter
2015-08-18  8:30                             ` [PATCH 15/21] net: mac80211_hwsim: " Phil Sutter
2015-08-18  8:30                               ` [PATCH 16/21] net: batman-adv: " Phil Sutter
2015-08-18  8:30                                 ` [PATCH 17/21] net: hsr: " Phil Sutter
2015-08-18  8:30                                   ` [PATCH 18/21] net: caif: " Phil Sutter
2015-08-18  8:30                                     ` [PATCH 19/21] staging: wilc1000: " Phil Sutter
2015-08-18  8:30                                       ` [PATCH 20/21] net: warn if drivers set tx_queue_len = 0 Phil Sutter
2015-08-18  8:30                                         ` Phil Sutter [this message]
2015-08-18 14:47                                         ` Eric Dumazet
2015-08-18 18:14                                           ` Phil Sutter
2015-08-19 18:39                                           ` Phil Sutter
2015-08-19 20:21                                             ` Phil Sutter
2015-08-19 20:31                                               ` Eric Dumazet
2015-08-19 20:33                                                 ` Eric Dumazet
2015-08-19 21:04                                                   ` Phil Sutter
2015-08-18  8:43                               ` [PATCH 15/21] net: mac80211_hwsim: convert to using IFF_NO_QUEUE Johannes Berg
2015-08-18 18:54                                 ` David Miller
2015-08-18 18:56 ` [PATCH 00/21] net: Convert drivers to IFF_NO_QUEUE and cleanup afterwards David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1439886649-24166-22-git-send-email-phil@nwl.cc \
    --to=phil@nwl.cc \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=jhs@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).