Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jonathan Morton <chromatix99@gmail.com>
Cc: "Dave Täht" <d@taht.net>, "David Miller" <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>
Subject: Re: ECN + pfifo_fast borked? (Was Re: [Bloat] shaper team forming up)
Date: Tue, 15 Mar 2011 19:28:34 +0100	[thread overview]
Message-ID: <1300213714.2927.37.camel@edumazet-laptop> (raw)
In-Reply-To: <3D05C1F1-B75E-426B-8267-6DB5323A839D@gmail.com>

Le mardi 15 mars 2011 à 19:09 +0200, Jonathan Morton a écrit :
> On 15 Mar, 2011, at 8:15 am, Eric Dumazet wrote:
> 
> > band 0 : high priority packets (like now)
> > band 1 : (old band 1, ECN capable flows)
> > band 2 : (old band 1, no ECN flows)
> > band 3 : low priority packets (old band 2)
> 
> This seems good to me.  It would provide a concrete (if minor) enticement to turn ECN on.
> 
>  

Here is a patch to implement that, on top of net-next-2.6 git tree

qdisc pfifo_fast 0: dev eth1 root refcnt 2 bands 4 priomap  2 1 3 3 2 3 0 0 2 2 2 2 2 2 2 2
 Sent 168 bytes 2 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0 


diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index c84b659..95ddf54 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -412,19 +412,39 @@ static struct Qdisc noqueue_qdisc = {
 };
 
 
-static const u8 prio2band[TC_PRIO_MAX + 1] = {
-	1, 2, 2, 2, 1, 2, 0, 0 , 1, 1, 1, 1, 1, 1, 1, 1
+/* 4-band FIFO queue: old style, but should be a bit faster than
+   generic prio+fifo combination.
+ */
+
+enum {
+	BAND_HIGH_PRIO,
+	BAND_MEDIUM_ECN_PRIO,
+	BAND_MEDIUM_PRIO,
+	BAND_LOW_PRIO,
+
+	PFIFO_FAST_BANDS
 };
 
-/* 3-band FIFO queue: old style, but should be a bit faster than
-   generic prio+fifo combination.
+/*
+ * We give a litle incent to ECN flows
  */
+static const u8 prio2band[TC_PRIO_MAX + 1] = {
+	[TC_PRIO_BESTEFFORT]	= BAND_MEDIUM_PRIO,
+	[TC_PRIO_FILLER]	= BAND_MEDIUM_ECN_PRIO,
+	[TC_PRIO_BULK]		= BAND_LOW_PRIO,
+	[TC_PRIO_BULK + 1]	= BAND_LOW_PRIO,
+	[TC_PRIO_INTERACTIVE_BULK] = BAND_MEDIUM_PRIO,
+	[TC_PRIO_INTERACTIVE_BULK + 1] = BAND_LOW_PRIO,
+	[TC_PRIO_INTERACTIVE]	= BAND_HIGH_PRIO,
+	[TC_PRIO_CONTROL]	= BAND_HIGH_PRIO,
+
+	[TC_PRIO_CONTROL+1 ... TC_PRIO_MAX] = BAND_MEDIUM_PRIO,
+};
 
-#define PFIFO_FAST_BANDS 3
 
 /*
  * Private data for a pfifo_fast scheduler containing:
- * 	- queues for the three band
+ * 	- queues for the four bands
  * 	- bitmap indicating which of the bands contain skbs
  */
 struct pfifo_fast_priv {
@@ -436,9 +456,13 @@ struct pfifo_fast_priv {
  * Convert a bitmap to the first band number where an skb is queued, where:
  * 	bitmap=0 means there are no skbs on any band.
  * 	bitmap=1 means there is an skb on band 0.
- *	bitmap=7 means there are skbs on all 3 bands, etc.
+ * 	bitmap=2 means there is an skb on band 1.
+ *	bitmap=15 means there are skbs on all 4 bands.
  */
-static const int bitmap2band[] = {-1, 0, 1, 0, 2, 0, 1, 0};
+static const int bitmap2band[1 << PFIFO_FAST_BANDS] = {
+	-1, 0, 1, 0, 2, 0, 1, 0,
+	 3, 0, 1, 0, 2, 0, 1, 0
+};
 
 static inline struct sk_buff_head *band2list(struct pfifo_fast_priv *priv,
 					     int band)



  reply	other threads:[~2011-03-15 18:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87wrk1a4gx.fsf@cruithne.co.teklibre.org>
     [not found] ` <5BC42741-852B-4699-BA5D-D70B8D610D96@gmail.com>
2011-03-14 20:24   ` [Bloat] shaper team forming up Eric Dumazet
2011-03-15  4:42     ` Eric Dumazet
2011-03-15  5:27       ` ECN + pfifo_fast borked? (Was Re: [Bloat] shaper team forming up) Dave Täht
2011-03-15  6:15         ` Eric Dumazet
2011-03-15 17:09           ` Jonathan Morton
2011-03-15 18:28             ` Eric Dumazet [this message]
2011-03-15 18:37               ` Jonathan Morton
2011-03-15 19:56                 ` Eric Dumazet
2011-03-15 22:51       ` [Bloat] shaper team forming up David Miller
2011-03-15 22:53       ` David Miller
2011-03-15 23:00         ` Eric Dumazet
2011-03-15 23:56         ` [PATCH] net_sched: fix ip_tos2prio Eric Dumazet
2011-03-16  1:54           ` 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=1300213714.2927.37.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=chromatix99@gmail.com \
    --cc=d@taht.net \
    --cc=davem@davemloft.net \
    --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