From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.toke.dk (mail.toke.dk [52.28.52.200]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id EB02E3BA8E for ; Wed, 25 Apr 2018 15:15:39 -0400 (EDT) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=toke.dk; s=20161023; t=1524683738; bh=gsLy/sQQJgkdseIfoxRAryVgLS19UwyArsoNJyVqjjE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=mBo3z2UOhUn0nP1vWIg+98LHhmB5J3R8OvA5wB5P0xDy3GBtjvaVbG27/hIBfg/OA rOcNv7swCYDb/ohLNvG7xuxLLCFzgU0GI+GNmnzcO5iTkA3qjO1a4KyUKoZDPBsWvL /M9Fpr1hnMSJPGkXQcvquCrdRc9OT8CayPq1Akx26S7Y0KeeMjoF/PJJqAg19ECayO YZnpPVwAk+KbANaTAUvrAE0jDSsT2/N65yU9yKZ2h2uGsUMs/YV8mauzXRFedj3Qbt kPXE2iew2Vbm39v99dO2JuGs5ikRZmqE4UxtFWa8LIehm6LHcP+02oF0Ld1SzyEuTL I4297VQtY26DQ== To: Eric Dumazet , Jonathan Morton Cc: netdev@vger.kernel.org, cake@lists.bufferbloat.net In-Reply-To: <688ac6e7-dd6d-d0ff-ee37-a0e2a0ea761c@gmail.com> References: <20180425134249.21300-1-toke@toke.dk> <878t9b5n0q.fsf@toke.dk> <6bc11ded-028f-6c8f-964e-a569b4e10813@gmail.com> <8736zj6zj2.fsf@toke.dk> <8bae2ee1-efcc-1571-2a30-5b7779de2c88@gmail.com> <87lgdb5e4w.fsf@toke.dk> <688ac6e7-dd6d-d0ff-ee37-a0e2a0ea761c@gmail.com> Date: Wed, 25 Apr 2018 21:15:36 +0200 X-Clacks-Overhead: GNU Terry Pratchett Message-ID: <874ljz5c87.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Cake] [PATCH net-next v3] Add Common Applications Kept Enhanced (cake) qdisc X-BeenThere: cake@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: Cake - FQ_codel the next generation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 19:15:40 -0000 Eric Dumazet writes: > On 04/25/2018 11:34 AM, Toke H=C3=B8iland-J=C3=B8rgensen wrote: >> Eric Dumazet writes: >>=20 >>> On 04/25/2018 09:52 AM, Jonathan Morton wrote: >>>>> We can see here the high cost of forcing software GSO :/ >>>>> >>>>> Really, this should be done only : >>>>> 1) If requested by the admin ( tc .... gso ....) >>>>> >>>>> 2) If packet size is above a threshold. >>>>> The threshold could be set by the admin, and/or based on a fraction = of the bandwidth parameter. >>>>> >>>>> I totally understand why you prefer to segment yourself for < 100 Mbi= t links. >>>>> >>>>> But this makes no sense on 10Gbit+ >>>> >>>> It is absolutely necessary, so far as I can see, to segment GSO >>>> superpackets when overhead compensation is selected - as it very >>>> often should be, even on pure Ethernet links. Without that, the >>>> calculation of link occupancy time will be wrong. (The actual >>>> transmission time of an Ethernet frame is rather more than just 14 >>>> bytes longer than the underlying IP packet.) >>> >>> Just fix the overhead compensation computation in the code. >>> >>> skb in a qdisc have everything you need. >>> >>> qdisc_pkt_len_init() has initialized qdisc_skb_cb(skb)->pkt_len with >>> the exact bytes on the wire, and you have gso_segs to perform any >>> adjustement you need to do. >>=20 >> The problem is that may not be the right values. For example, in many >> CPEs there's a built-in switch that strips VLAN tags before the packet >> actually hits the wire. So we do need to be able to get the actual >> packet size. Is it possible to get the sizes of the individual segments >> of a GSO packet? That way we could do the calculation for the whole >> super-packet... > > All segments of GSO packets have the same size, by definition. > > Only the last segment might be smaller, and again this can be inferred > from gso_size and gso_segs Gotcha. Until we are confident that we've implemented this in a way that works, will this do? @@ -88,6 +88,7 @@ #define CAKE_SET_WAYS (8) #define CAKE_MAX_TINS (8) #define CAKE_QUEUES (1024) +#define CAKE_SPLIT_GSO_THRESHOLD (125000000) /* 1Gbps */ @@ -1437,7 +1439,7 @@ static s32 cake_enqueue(struct sk_buff *skb, struct Q= disc *sch, * or if we need to know individual packet sizes for framing overhe= ad. */ =20 - if (skb_is_gso(skb)) { + if (skb_is_gso(skb) && q->rate_flags & CAKE_FLAG_SPLIT_GSO) { struct sk_buff *segs, *nskb; netdev_features_t features =3D netif_skb_features(skb); /* signed slen to handle corner case @@ -2337,6 +2339,12 @@ static int cake_change(struct Qdisc *sch, struct nla= ttr *opt, if (tb[TCA_CAKE_MEMORY]) q->buffer_config_limit =3D nla_get_u32(tb[TCA_CAKE_MEMORY]); =20 + if (q->rate_bps && (q->rate_bps <=3D CAKE_SPLIT_GSO_THRESHOLD || + q->rate_flags & CAKE_FLAG_OVERHEAD)) + q->rate_flags |=3D CAKE_FLAG_SPLIT_GSO; + else + q->rate_flags &=3D ~CAKE_FLAG_SPLIT_GSO; + if (q->tins) { sch_tree_lock(sch); cake_reconfigure(sch);