From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-04-iad.dyndns.com (mxout-075-iad.mailhop.org [216.146.32.75]) by lists.bufferbloat.net (Postfix) with ESMTP id 7177B2E04DB for ; Thu, 24 Mar 2011 06:44:10 -0700 (PDT) Received: from scan-02-iad.mailhop.org (scan-02-iad.local [10.150.0.207]) by mail-04-iad.dyndns.com (Postfix) with ESMTP id A0BA1833F93 for ; Thu, 24 Mar 2011 13:44:11 +0000 (UTC) X-Spam-Score: -1.0 (-) X-Mail-Handler: MailHop by DynDNS X-Originating-IP: 209.85.210.171 Received: from mail-iy0-f171.google.com (mail-iy0-f171.google.com [209.85.210.171]) by mail-04-iad.dyndns.com (Postfix) with ESMTP id 3E4E8833F34 for ; Thu, 24 Mar 2011 13:44:11 +0000 (UTC) Received: by iyf40 with SMTP id 40so13169411iyf.16 for ; Thu, 24 Mar 2011 06:44:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=P8vcAVzs0C5Tc0rvFTMjKJO9S79Cn0k7Y48Ic5qkI5Y=; b=TzKSE3/TSK3cwSZaS3k2qS98+DB5lBFZrmvCWzhyzAyRGGG3WNigivs8Xy5Kf6WDQv V3zR43wy+K5xSxNfGA/X+XimQwLNMwsfQvfg49ZyPlCu7j2hijf8qIOUo9sKhNMbBLQy qIy9DAD5AdRDfvIYCssYdmb/TtvCPLrmTClW4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=EjVjLpTDn1XvuNiwuZCqZMeGsmAbjnwcmacQLhWUP0fxG9ol/yeybVO83D49E7mFkd 0XOd8HyaWDDzhVV1CrJxsM5GSbXYExGRzEKub2aYxujGWqj0k8/FEumVNoSqmy/UUIQ6 1L79bLxmlHzEK4dNzq/A/pmJn3elHqc7DQEBY= MIME-Version: 1.0 Received: by 10.231.112.216 with SMTP id x24mr8144507ibp.56.1300974248704; Thu, 24 Mar 2011 06:44:08 -0700 (PDT) Received: by 10.231.17.132 with HTTP; Thu, 24 Mar 2011 06:44:08 -0700 (PDT) In-Reply-To: <1300973556.3747.9.camel@edumazet-laptop> References: <7imxklz5vu.fsf@lanthane.pps.jussieu.fr> <160809C8-284C-4463-97FE-0E2F03C08589@gmail.com> <1300973556.3747.9.camel@edumazet-laptop> Date: Thu, 24 Mar 2011 09:44:08 -0400 Message-ID: Subject: Re: [Bloat] Thoughts on Stochastic Fair Blue From: Dave Taht To: Eric Dumazet Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: bloat-devel@lists.bufferbloat.net 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: Thu, 24 Mar 2011 13:44:10 -0000 Can we try to keep coding stuff on bloat-devel? The traffic level on bloat is (wonderfully) huge as it is, but a goodly percentage of the audience can't deal at this level. Eric had also sent me an interesting attempt at a 4 band pfifo_fast, which explicitly prioritized ecn-enabled packets, I was wondering if he could resend? How does all these stuff cope with encapsulated (vpn/6in4) packets? UDP pac= kets? On Thu, Mar 24, 2011 at 9:32 AM, Eric Dumazet wrot= e: > Le jeudi 24 mars 2011 =E0 14:40 +0200, Jonathan Morton a =E9crit : > >> Finally, it might also be interesting and useful to add bare-bones ECN >> support to the existing "dumb" qdiscs, such as SFQ and the FIFO >> family. =A0Simply start marking (and dropping non-supporting flows) when >> the queue is more than half full. > > Three months ago, I played with a SFQ patch to add ECN support, based on > delay of packet in queue. > > http://www.spinics.net/lists/netdev/msg151594.html > > This patch is a hack of course (units are jiffies ticks, not ms) > > > -------------------------------------- > > Here is the POC patch I am currently testing, with a probability to > "early drop" a packet of one percent per ms (HZ=3D1000 here), only if > packet stayed at least 4 ms on queue. > > Of course, this only apply where SFQ is used, with known SFQ limits :) > > The term "early drop" is a lie. RED really early mark/drop a packet at > enqueue() time, while I do it at dequeue() time [since I need to compute > the delay]. But effect is the same on sent packets. This might use a bit > more memory, but no more than current SFQ [and only if flows dont react > to mark/drops] > > insmod net/sched/sch_sfq.ko red_delay=3D4 > > By the way, I do think we should lower SFQ_DEPTH a bit and increase > SFQ_SLOTS by same amount. Allowing 127 packets per flow seems not > necessary in most situations SFQ might be used. > > =A0net/sched/sch_sfq.c | =A0 37 +++++++++++++++++++++++++++++++++---- > =A01 files changed, 33 insertions(+), 4 deletions(-) > > diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c > index d54ac94..4f958e3 100644 > --- a/net/sched/sch_sfq.c > +++ b/net/sched/sch_sfq.c > @@ -24,6 +24,8 @@ > =A0#include > =A0#include > =A0#include > +#include > +#include > > > =A0/* =A0 =A0 Stochastic Fairness Queuing algorithm. > @@ -86,6 +88,10 @@ > =A0/* This type should contain at least SFQ_DEPTH + SFQ_SLOTS values */ > =A0typedef unsigned char sfq_index; > > +static int red_delay; /* default : no RED handling */ > +module_param(red_delay, int, 0); > +MODULE_PARM_DESC(red_delay, "mark/drop packets if they stay in queue lon= ger than red_delay ticks"); > + > =A0/* > =A0* We dont use pointers to save space. > =A0* Small indexes [0 ... SFQ_SLOTS - 1] are 'pointers' to slots[] array > @@ -391,6 +397,7 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch) > > =A0 =A0 =A0 =A0sch->qstats.backlog +=3D qdisc_pkt_len(skb); > =A0 =A0 =A0 =A0slot_queue_add(slot, skb); > + =A0 =A0 =A0 qdisc_skb_cb(skb)->timestamp =3D jiffies; > =A0 =A0 =A0 =A0sfq_inc(q, x); > =A0 =A0 =A0 =A0if (slot->qlen =3D=3D 1) { =A0 =A0 =A0 =A0 =A0/* The flow = is new */ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (q->tail =3D=3D NULL) { =A0/* It is the= first flow */ > @@ -402,11 +409,8 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0q->tail =3D slot; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0slot->allot =3D q->scaled_quantum; > =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 if (++sch->q.qlen <=3D q->limit) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 sch->bstats.bytes +=3D qdisc_pkt_len(skb); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 sch->bstats.packets++; > + =A0 =A0 =A0 if (++sch->q.qlen <=3D q->limit) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return NET_XMIT_SUCCESS; > - =A0 =A0 =A0 } > > =A0 =A0 =A0 =A0sfq_drop(sch); > =A0 =A0 =A0 =A0return NET_XMIT_CN; > @@ -432,6 +436,7 @@ sfq_dequeue(struct Qdisc *sch) > =A0 =A0 =A0 =A0sfq_index a, next_a; > =A0 =A0 =A0 =A0struct sfq_slot *slot; > > +restart: > =A0 =A0 =A0 =A0/* No active slots */ > =A0 =A0 =A0 =A0if (q->tail =3D=3D NULL) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return NULL; > @@ -455,12 +460,36 @@ next_slot: > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0next_a =3D slot->next; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (a =3D=3D next_a) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0q->tail =3D NULL; /* no mo= re active slots */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* last packet queued, dont= even try to apply RED */ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return skb; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0q->tail->next =3D next_a; > =A0 =A0 =A0 =A0} else { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0slot->allot -=3D SFQ_ALLOT_SIZE(qdisc_pkt_= len(skb)); > =A0 =A0 =A0 =A0} > + =A0 =A0 =A0 if (red_delay) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 long delay =3D jiffies - qdisc_skb_cb(skb)-= >timestamp; > + > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (delay >=3D red_delay) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 long Px =3D delay * (0xFFFF= FF / 100); /* 1 percent per jiffy */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((net_random() & 0xFFFFF= F) < Px) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (INET_EC= N_set_ce(skb)) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 /* no ecnmark counter yet :) */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 sch->qstats.overlimits++; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 /* penalize this flow : we drop the > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0* packet while we changed slot->allot > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0*/ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 kfree_skb(skb); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 /* no early_drop counter yet :) */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 sch->qstats.drops++; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 goto restart; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + =A0 =A0 =A0 } > + =A0 =A0 =A0 sch->bstats.bytes +=3D qdisc_pkt_len(skb); > + =A0 =A0 =A0 sch->bstats.packets++; > =A0 =A0 =A0 =A0return skb; > =A0} > > > > _______________________________________________ > Bloat mailing list > Bloat@lists.bufferbloat.net > https://lists.bufferbloat.net/listinfo/bloat > --=20 Dave T=E4ht SKYPE: davetaht US Tel: 1-239-829-5608 http://the-edge.blogspot.com