From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: Eric Dumazet <eric.dumazet@gmail.com>,
Jonathan Morton <chromatix99@gmail.com>
Cc: netdev@vger.kernel.org, cake@lists.bufferbloat.net
Subject: Re: [Cake] [PATCH net-next v3] Add Common Applications Kept Enhanced (cake) qdisc
Date: Wed, 25 Apr 2018 21:15:36 +0200 [thread overview]
Message-ID: <874ljz5c87.fsf@toke.dk> (raw)
In-Reply-To: <688ac6e7-dd6d-d0ff-ee37-a0e2a0ea761c@gmail.com>
Eric Dumazet <eric.dumazet@gmail.com> writes:
> On 04/25/2018 11:34 AM, Toke Høiland-Jørgensen wrote:
>> Eric Dumazet <eric.dumazet@gmail.com> writes:
>>
>>> 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 Mbit 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.
>>
>> 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 Qdisc *sch,
* or if we need to know individual packet sizes for framing overhead.
*/
- 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 = netif_skb_features(skb);
/* signed slen to handle corner case
@@ -2337,6 +2339,12 @@ static int cake_change(struct Qdisc *sch, struct nlattr *opt,
if (tb[TCA_CAKE_MEMORY])
q->buffer_config_limit = nla_get_u32(tb[TCA_CAKE_MEMORY]);
+ if (q->rate_bps && (q->rate_bps <= CAKE_SPLIT_GSO_THRESHOLD ||
+ q->rate_flags & CAKE_FLAG_OVERHEAD))
+ q->rate_flags |= CAKE_FLAG_SPLIT_GSO;
+ else
+ q->rate_flags &= ~CAKE_FLAG_SPLIT_GSO;
+
if (q->tins) {
sch_tree_lock(sch);
cake_reconfigure(sch);
next prev parent reply other threads:[~2018-04-25 19:15 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-25 13:42 Toke Høiland-Jørgensen
2018-04-25 13:42 ` [Cake] [PATCH ipruote2-next v4] Add support for cake qdisc Toke Høiland-Jørgensen
2018-04-25 14:52 ` [Cake] [PATCH net-next v3] Add Common Applications Kept Enhanced (cake) qdisc Eric Dumazet
2018-04-25 15:22 ` Toke Høiland-Jørgensen
2018-04-25 15:48 ` Eric Dumazet
2018-04-25 15:51 ` Eric Dumazet
2018-04-25 16:06 ` Toke Høiland-Jørgensen
2018-04-25 16:29 ` Eric Dumazet
2018-04-25 16:52 ` Jonathan Morton
2018-04-25 16:57 ` Eric Dumazet
2018-04-25 18:34 ` Toke Høiland-Jørgensen
2018-04-25 18:48 ` David Miller
2018-04-25 19:02 ` Eric Dumazet
2018-04-25 19:15 ` Toke Høiland-Jørgensen [this message]
2018-04-25 17:54 ` Sebastian Moeller
2018-04-25 16:55 ` Toke Høiland-Jørgensen
2018-04-25 16:59 ` Eric Dumazet
2018-04-25 16:00 ` Eric Dumazet
2018-04-25 16:17 ` Toke Høiland-Jørgensen
2018-04-25 17:43 ` Eric Dumazet
2018-04-25 18:35 ` Toke Høiland-Jørgensen
2018-04-25 18:39 ` David Miller
2018-04-25 18:46 ` Toke Høiland-Jørgensen
2018-04-27 10:54 ` kbuild test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.bufferbloat.net/postorius/lists/cake.lists.bufferbloat.net/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874ljz5c87.fsf@toke.dk \
--to=toke@toke.dk \
--cc=cake@lists.bufferbloat.net \
--cc=chromatix99@gmail.com \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox