From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qc0-f171.google.com (mail-qc0-f171.google.com [209.85.216.171]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (verified OK)) by huchra.bufferbloat.net (Postfix) with ESMTPS id 406A1201AEE for ; Thu, 28 Jun 2012 16:52:19 -0700 (PDT) Received: by qcad1 with SMTP id d1so15196qca.16 for ; Thu, 28 Jun 2012 16:52:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding:x-system-of-record; bh=4+H7cc+5e9QoAaKOLTUs3JMsfqz8jCSIW1VQsGaZlvU=; b=QLe5RMrW+Dc0CCrw0dHDknnLAGMGrXo9WRXHjugs6r7kw4D4hqG8niB0JIAiMLA/Lj Gy2GVMbDagVvy8e+Bx25zrzvdb1r0MQl7b7vTftjXJHv8eu97UgNWPSRlVpGaZQpKP8u DT7cRV2yNIKhxUIv6KU3nSe/VJzc8XPU/EyR6X/yg2ORCD3Fq8QCE2w3y1a2qFifurSh TsPM72oAqTQyULAOjatMsA66D1lMwuPEBhMVvFTcQxMvbf31ungrZubEGLuuwzCOEr82 ezyN+x39hAfPtlBqtBB5HiMIXyRE9aBrLN6YeFc+A4Mv5fjdhsEvhq7zZepYs9xJE7LF eyDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding:x-system-of-record :x-gm-message-state; bh=4+H7cc+5e9QoAaKOLTUs3JMsfqz8jCSIW1VQsGaZlvU=; b=S0Clm6EDh7xthIm+QArc0FfinEfKfLLQKokP389ZIqb/hUYufVik+i8WKEHCLKb0PQ qoi26JlHmYKcFXMsyG46Dgkdt5dKAZeOLrbau08N/I8lXgXP6Jko8gL5lmS2Zw1V4eqk 29CcNf1lrmvu9wQ0Z+IeFmv1YiHLAItZ/8CQWXeDwccDLU9f7WAzpj0b3BJOmCgqre3/ neF4yrsep4HKjY40DB3gaLpkU7GlcKYPee6KNoEwjT5wE6Mq14azqUELfLE9LKvU7+Lx uPoErejSfjq59dKyqR8WOZ4y6V55rz8I38QVuyMGvt6NJn5p/8QmzINni3eKePrfuDEj h+Vg== Received: by 10.229.105.166 with SMTP id t38mr1804794qco.136.1340927537950; Thu, 28 Jun 2012 16:52:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.105.166 with SMTP id t38mr1804779qco.136.1340927537630; Thu, 28 Jun 2012 16:52:17 -0700 (PDT) Received: by 10.229.59.41 with HTTP; Thu, 28 Jun 2012 16:52:17 -0700 (PDT) In-Reply-To: <1340903237.13187.151.camel@edumazet-glaptop> References: <1340903237.13187.151.camel@edumazet-glaptop> Date: Thu, 28 Jun 2012 16:52:17 -0700 Message-ID: From: Nandita Dukkipati To: Eric Dumazet Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-Gm-Message-State: ALoCoQl0t4ISZZTPSeFsxST3sGpLNxX2a4w7sGezq/Z9o4649gj67mBgZ3RGHMp3EWuhc0blRiixyomcX4DUTS6WtJfghgkCNwlRuGJdCN8wMxrDGeeuc6dpwqzgiQvlfsN1avOVvYvqbvXFXzBEcX6HQ5xsEpSh9cZP23pktu+awNLvjZPwXPrBPnmWQ+qWsrJH3TNaPDhw X-Mailman-Approved-At: Thu, 28 Jun 2012 16:57:07 -0700 Cc: netdev , Yuchung Cheng , codel@lists.bufferbloat.net, Matt Mathis , Neal Cardwell , David Miller Subject: Re: [Codel] [PATCH net-next] fq_codel: report congestion notification at enqueue time X-BeenThere: codel@lists.bufferbloat.net X-Mailman-Version: 2.1.13 Precedence: list List-Id: CoDel AQM discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 23:52:19 -0000 As you know I really like this idea. My main concern is that the same packet could cause TCP to reduce cwnd twice within an RTT - first on enqueue and then if this packet is ECN marked on dequeue. I don't think this is the desired behavior. Can we avoid it? On Thu, Jun 28, 2012 at 10:07 AM, Eric Dumazet wro= te: > From: Eric Dumazet > > At enqueue time, check sojourn time of packet at head of the queue, > and return NET_XMIT_CN instead of NET_XMIT_SUCCESS if this sejourn > time is above codel @target. > > This permits local TCP stack to call tcp_enter_cwr() and reduce its cwnd > without drops (for example if ECN is not enabled for the flow) > > Signed-off-by: Eric Dumazet > Cc: Dave Taht > Cc: Tom Herbert > Cc: Matt Mathis > Cc: Yuchung Cheng > Cc: Nandita Dukkipati > Cc: Neal Cardwell > --- > =A0include/linux/pkt_sched.h | =A0 =A01 + > =A0include/net/codel.h =A0 =A0 =A0 | =A0 =A02 +- > =A0net/sched/sch_fq_codel.c =A0| =A0 19 +++++++++++++++---- > =A03 files changed, 17 insertions(+), 5 deletions(-) > > diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h > index 32aef0a..4d409a5 100644 > --- a/include/linux/pkt_sched.h > +++ b/include/linux/pkt_sched.h > @@ -714,6 +714,7 @@ struct tc_fq_codel_qd_stats { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 */ > =A0 =A0 =A0 =A0__u32 =A0 new_flows_len; =A0/* count of flows in new list = */ > =A0 =A0 =A0 =A0__u32 =A0 old_flows_len; =A0/* count of flows in old list = */ > + =A0 =A0 =A0 __u32 =A0 congestion_count; > =A0}; > > =A0struct tc_fq_codel_cl_stats { > diff --git a/include/net/codel.h b/include/net/codel.h > index 550debf..8c7d6a7 100644 > --- a/include/net/codel.h > +++ b/include/net/codel.h > @@ -148,7 +148,7 @@ struct codel_vars { > =A0* struct codel_stats - contains codel shared variables and stats > =A0* @maxpacket: largest packet we've seen so far > =A0* @drop_count: =A0 =A0 =A0 =A0temp count of dropped packets in dequeue= () > - * ecn_mark: =A0 number of packets we ECN marked instead of dropping > + * @ecn_mark: =A0number of packets we ECN marked instead of dropping > =A0*/ > =A0struct codel_stats { > =A0 =A0 =A0 =A0u32 =A0 =A0 =A0 =A0 =A0 =A0 maxpacket; > diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c > index 9fc1c62..c0485a0 100644 > --- a/net/sched/sch_fq_codel.c > +++ b/net/sched/sch_fq_codel.c > @@ -62,6 +62,7 @@ struct fq_codel_sched_data { > =A0 =A0 =A0 =A0struct codel_stats cstats; > =A0 =A0 =A0 =A0u32 =A0 =A0 =A0 =A0 =A0 =A0 drop_overlimit; > =A0 =A0 =A0 =A0u32 =A0 =A0 =A0 =A0 =A0 =A0 new_flow_count; > + =A0 =A0 =A0 u32 =A0 =A0 =A0 =A0 =A0 =A0 congestion_count; > > =A0 =A0 =A0 =A0struct list_head new_flows; =A0 =A0 /* list of new flows *= / > =A0 =A0 =A0 =A0struct list_head old_flows; =A0 =A0 /* list of old flows *= / > @@ -196,16 +197,25 @@ static int fq_codel_enqueue(struct sk_buff *skb, st= ruct Qdisc *sch) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flow->deficit =3D q->quantum; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flow->dropped =3D 0; > =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 if (++sch->q.qlen < sch->limit) > + =A0 =A0 =A0 if (++sch->q.qlen < sch->limit) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 codel_time_t hdelay =3D codel_get_enqueue_t= ime(skb) - > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= codel_get_enqueue_time(flow->head); > + > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* If this flow is congested, tell the call= er ! */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (codel_time_after(hdelay, q->cparams.tar= get)) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 q->congestion_count++; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return NET_XMIT_CN; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return NET_XMIT_SUCCESS; > - > + =A0 =A0 =A0 } > =A0 =A0 =A0 =A0q->drop_overlimit++; > =A0 =A0 =A0 =A0/* Return Congestion Notification only if we dropped a pac= ket > =A0 =A0 =A0 =A0 * from this flow. > =A0 =A0 =A0 =A0 */ > - =A0 =A0 =A0 if (fq_codel_drop(sch) =3D=3D idx) > + =A0 =A0 =A0 if (fq_codel_drop(sch) =3D=3D idx) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 q->congestion_count++; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return NET_XMIT_CN; > - > + =A0 =A0 =A0 } > =A0 =A0 =A0 =A0/* As we dropped a packet, better let upper stack know thi= s */ > =A0 =A0 =A0 =A0qdisc_tree_decrease_qlen(sch, 1); > =A0 =A0 =A0 =A0return NET_XMIT_SUCCESS; > @@ -467,6 +477,7 @@ static int fq_codel_dump_stats(struct Qdisc *sch, str= uct gnet_dump *d) > > =A0 =A0 =A0 =A0st.qdisc_stats.maxpacket =3D q->cstats.maxpacket; > =A0 =A0 =A0 =A0st.qdisc_stats.drop_overlimit =3D q->drop_overlimit; > + =A0 =A0 =A0 st.qdisc_stats.congestion_count =3D q->congestion_count; > =A0 =A0 =A0 =A0st.qdisc_stats.ecn_mark =3D q->cstats.ecn_mark; > =A0 =A0 =A0 =A0st.qdisc_stats.new_flow_count =3D q->new_flow_count; > > >