From: Keir Fraser Subject: Re: Linux Traffic Shaping broken in 3.0.3rc1 ? Date: Mon, 09 Oct 2006 16:40:56 +0100 Message-ID: References: <20061007192115.28680@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20061007192115.28680@gmx.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Timo Benk , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 7/10/06 20:21, "Timo Benk" wrote: > with Xen 3.0.2 i used tc to limit the outgoing traffic rate and it > worked very well and accurate with the HTB class: > Limit: 1mbit / actual rate: 116.2KB/s (given by scp) > > Now i looked at 3.0.3rc1 and noticed that traffic shaping using the same > setup as before does not work as accurate as before (same hardware): > Limit: 1mbit / actual rate: 449.0KB/s (given by scp) This is not a Xen-specific bug. The problem is that now we support TSO, packets are larger than the maximum that TC expects and so we overflow the pre-computed rate table (and our 8kB packets get treated as 1.6kB packets). To see this, run 'tc -s class show dev peth0'. You'll see a 'giants' field that is non-zero -- those are all packets that were too big to handle properly. The fix is simple. Add an explicit mtu parameter to the htb class: tc class add dev peth0 parent 1:0 classid 1:1 htb rate 1mbit mtu 16000 Regards, Keir