From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [patch net-next] tbf: handle gso skbs properly Date: Fri, 15 Feb 2013 08:13:03 -0800 Message-ID: <1360944783.19353.9.camel@edumazet-glaptop> References: <1360941882-6727-1-git-send-email-jiri@resnulli.us> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com, jhs@mojatatu.com, kuznet@ms2.inr.ac.ru, j.vimal@gmail.com To: Jiri Pirko Return-path: Received: from mail-pb0-f51.google.com ([209.85.160.51]:34415 "EHLO mail-pb0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932675Ab3BOQNH (ORCPT ); Fri, 15 Feb 2013 11:13:07 -0500 Received: by mail-pb0-f51.google.com with SMTP id un15so655371pbc.38 for ; Fri, 15 Feb 2013 08:13:06 -0800 (PST) In-Reply-To: <1360941882-6727-1-git-send-email-jiri@resnulli.us> Sender: netdev-owner@vger.kernel.org List-ID: On Fri, 2013-02-15 at 16:24 +0100, Jiri Pirko wrote: > So far, gso skbs has been handled by tbf in the same way as any other > ones. Given their pkt_len they got dropped which leads to very > inaccurate rates. This patch makes tbf gso-aware. > > According to Eric's suggestion, when gso skb can't be sent in one mtu > time, resegment it. > > + do { > + next_skb = skb->next; > + qdisc_skb_cb(skb)->pkt_len = skb->len; > + qdisc_calculate_pkt_len(skb, qdisc); > + __skb_queue_after(&qdisc->q, prev_skb, skb); > + prev_skb = skb; > + skb = next_skb; > + num_skbs++; > + } while (skb); This only works if qdisc is a fifo (holding packets in qdisc->q) Please try : tc qdisc del dev eth0 root 2>/dev/null tc qdisc add dev eth0 root handle 10 tbf rate 0.5mbit burst 5kb latency 70ms peakrate 1mbit minburst 1540 tc qd add dev eth0 parent 10: handle 20 fq_codel I guess we need a per qdisc ops to reinject the packets at the right place.