From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-23-ewr.dyndns.com (mxout-129-ewr.mailhop.org [216.146.33.129]) by lists.bufferbloat.net (Postfix) with ESMTP id 34C4A2E0392 for ; Tue, 15 Mar 2011 11:37:46 -0700 (PDT) Received: from scan-22-ewr.mailhop.org (scan-22-ewr.local [10.0.141.244]) by mail-23-ewr.dyndns.com (Postfix) with ESMTP id 48248407CB for ; Tue, 15 Mar 2011 18:37:45 +0000 (UTC) X-Spam-Score: 0.1 () X-Mail-Handler: MailHop by DynDNS X-Originating-IP: 75.145.127.229 Received: from gw.co.teklibre.org (75-145-127-229-Colorado.hfc.comcastbusiness.net [75.145.127.229]) by mail-23-ewr.dyndns.com (Postfix) with ESMTP id 2B5793FEA7 for ; Tue, 15 Mar 2011 18:37:41 +0000 (UTC) Received: from cruithne.co.teklibre.org (unknown [IPv6:2002:4b91:7fe5:1::20]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "cruithne.co.teklibre.org", Issuer "CA Cert Signing Authority" (verified OK)) by gw.co.teklibre.org (Postfix) with ESMTPS id 9FA765EA31 for ; Tue, 15 Mar 2011 12:37:40 -0600 (MDT) Received: by cruithne.co.teklibre.org (Postfix, from userid 1000) id BFA9812085C; Tue, 15 Mar 2011 12:37:39 -0600 (MDT) From: d@taht.net (Dave =?utf-8?Q?T=C3=A4ht?=) To: bloat-devel Subject: Re: ECN + pfifo_fast borked? Organization: Teklibre - http://www.teklibre.com References: <87wrk1a4gx.fsf@cruithne.co.teklibre.org> <5BC42741-852B-4699-BA5D-D70B8D610D96@gmail.com> <1300134277.2649.19.camel@edumazet-laptop> <1300164166.2649.70.camel@edumazet-laptop> <87ipvlosvz.fsf_-_@cruithne.co.teklibre.org> <1300169749.2649.142.camel@edumazet-laptop> <3D05C1F1-B75E-426B-8267-6DB5323A839D@gmail.com> <1300213714.2927.37.camel@edumazet-laptop> Date: Tue, 15 Mar 2011 12:37:39 -0600 In-Reply-To: <1300213714.2927.37.camel@edumazet-laptop> (Eric Dumazet's message of "Tue, 15 Mar 2011 19:28:34 +0100") Message-ID: <8739mogrgs.fsf@cruithne.co.teklibre.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: bloat-devel@lists.bufferbloat.net X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Developers working on AQM, device drivers, and networking stacks" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2011 18:37:46 -0000 Note: this is a forward of an existing conversation on netdev about how to prioritize ECN enabled packets better, in light of dan siemon's discovery that ECN + pfifo_fast was somewhat borked, over the weekend. There's a very simple patch for pfifo_fast also being evaluated. For reference to the problem being addressed, see: http://www.coverfire.com/archives/2011/03/13/pfifo_fast-and-ecn/ And the thread on netdev... Eric Dumazet writes: > Le mardi 15 mars 2011 =C3=A0 19:09 +0200, Jonathan Morton a =C3=A9crit : >> On 15 Mar, 2011, at 8:15 am, Eric Dumazet wrote: >>=20 >> > 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) >>=20 >> This seems good to me. It would provide a concrete (if minor) enticemen= t to turn ECN on. >>=20 >>=20=20 > > 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)=20 > backlog 0b 0p requeues 0=20 > > > 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 =3D { > }; >=20=20 >=20=20 > -static const u8 prio2band[TC_PRIO_MAX + 1] =3D { > - 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 > }; >=20=20 > -/* 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] =3D { > + [TC_PRIO_BESTEFFORT] =3D BAND_MEDIUM_PRIO, > + [TC_PRIO_FILLER] =3D BAND_MEDIUM_ECN_PRIO, > + [TC_PRIO_BULK] =3D BAND_LOW_PRIO, > + [TC_PRIO_BULK + 1] =3D BAND_LOW_PRIO, > + [TC_PRIO_INTERACTIVE_BULK] =3D BAND_MEDIUM_PRIO, > + [TC_PRIO_INTERACTIVE_BULK + 1] =3D BAND_LOW_PRIO, > + [TC_PRIO_INTERACTIVE] =3D BAND_HIGH_PRIO, > + [TC_PRIO_CONTROL] =3D BAND_HIGH_PRIO, > + > + [TC_PRIO_CONTROL+1 ... TC_PRIO_MAX] =3D BAND_MEDIUM_PRIO, > +}; >=20=20 > -#define PFIFO_FAST_BANDS 3 >=20=20 > /* > * 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, whe= re: > * bitmap=3D0 means there are no skbs on any band. > * bitmap=3D1 means there is an skb on band 0. > - * bitmap=3D7 means there are skbs on all 3 bands, etc. > + * bitmap=3D2 means there is an skb on band 1. > + * bitmap=3D15 means there are skbs on all 4 bands. > */ > -static const int bitmap2band[] =3D {-1, 0, 1, 0, 2, 0, 1, 0}; > +static const int bitmap2band[1 << PFIFO_FAST_BANDS] =3D { > + -1, 0, 1, 0, 2, 0, 1, 0, > + 3, 0, 1, 0, 2, 0, 1, 0 > +}; >=20=20 > static inline struct sk_buff_head *band2list(struct pfifo_fast_priv *pri= v, > int band) > > --=20 Dave Taht http://nex-6.taht.net