From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cassarossa.samfundet.no (cassarossa.samfundet.no [IPv6:2001:67c:29f4::29]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by huchra.bufferbloat.net (Postfix) with ESMTPS id 54A4421F1CF for ; Thu, 30 May 2013 02:53:08 -0700 (PDT) Received: from pannekake.samfundet.no ([2001:67c:29f4::50] ident=unknown) by cassarossa.samfundet.no with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1UhzXS-0000xw-DR; Thu, 30 May 2013 11:52:54 +0200 Received: from sesse by pannekake.samfundet.no with local (Exim 4.80) (envelope-from ) id 1UhzXR-0004P5-8z; Thu, 30 May 2013 11:52:53 +0200 Date: Thu, 30 May 2013 11:52:53 +0200 From: "Steinar H. Gunderson" To: Jesper Dangaard Brouer Message-ID: <20130530095253.GA8461@uio.no> References: <20130529151330.22c5c89e@redhat.com> <1369842724.5109.44.camel@edumazet-glaptop> <20130529155034.334092c5@nehalam.linuxnetplumber.net> <1369869506.5109.87.camel@edumazet-glaptop> <20130530111547.07397287@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20130530111547.07397287@redhat.com> X-Operating-System: Linux 3.9.0+sesse01 on a x86_64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= , Mike Frysinger , Jiri Pirko , netdev@vger.kernel.org, Jiri Benc , Steven Barth , "russell-tcatm@stuart.id.au" , bloat@lists.bufferbloat.net, David Miller , Jussi Kivilinna , Michal Soltys , Patrick McHardy , Felix Fietkau Subject: Re: [Bloat] tc linklayer ADSL calc broken after commit 56b765b79 (htb: improved accuracy at high rates) X-BeenThere: bloat@lists.bufferbloat.net X-Mailman-Version: 2.1.13 Precedence: list List-Id: General list for discussing Bufferbloat List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 09:53:08 -0000 On Thu, May 30, 2013 at 11:15:47AM +0200, Jesper Dangaard Brouer wrote: > int pkt_len = skb->len + (encap_overhead * gso_segments); > int wire_sz = DIV_ROUND_UP(pkt_len,48)*53; > > (I suspect, that the compiler might even optimize and remove any > real divisions, I bet Eric can tell us.) FWIW, GCC can change divisions by integer constants (even signed divisions) to some multiplies and shifts, by way of some number theory magic. /* Steinar */ -- Homepage: http://www.sesse.net/