Cake - FQ_codel the next generation
 help / color / mirror / Atom feed
From: Dave Taht <dave.taht@gmail.com>
To: Cake List <cake@lists.bufferbloat.net>
Subject: [Cake] quick patch for split_gso
Date: Tue, 24 Jul 2018 21:11:47 -0700	[thread overview]
Message-ID: <CAA93jw6kpexvu3J9WH+FPhWbeOGKEVRp8zXo3po1o82TWX9_oQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 301 bytes --]

I was happy to see the API didn't need to get modified.

Not even compile tested patch attached.

also, in looking at the gso code, when enabled, is there any way to pull the
actual packets out in the stats?

-- 

Dave Täht
CEO, TekLibre, LLC
http://www.teklibre.com
Tel: 1-669-226-2619

[-- Attachment #2: cake_split_gso.patch --]
[-- Type: text/x-patch, Size: 2257 bytes --]

diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
index 539c949..488cfc6 100644
--- a/net/sched/sch_cake.c
+++ b/net/sched/sch_cake.c
@@ -80,7 +80,6 @@
 #define CAKE_QUEUES (1024)
 #define CAKE_FLOW_MASK 63
 #define CAKE_FLOW_NAT_FLAG 64
-#define CAKE_SPLIT_GSO_THRESHOLD (125000000) /* 1Gbps */
 
 /* struct cobalt_params - contains codel and blue parameters
  * @interval:	codel initial drop rate
@@ -164,6 +163,7 @@ struct cake_tin_data {
 	u16	unresponsive_flow_count;
 
 	u32	max_skblen;
+	u32	split_gso;
 
 	struct list_head new_flows;
 	struct list_head old_flows;
@@ -260,7 +260,6 @@ enum {
 	CAKE_FLAG_AUTORATE_INGRESS = BIT(1),
 	CAKE_FLAG_INGRESS	   = BIT(2),
 	CAKE_FLAG_WASH		   = BIT(3),
-	CAKE_FLAG_SPLIT_GSO	   = BIT(4)
 };
 
 /* COBALT operates the Codel and BLUE algorithms in parallel, in order to
@@ -1651,7 +1650,7 @@ static s32 cake_enqueue(struct sk_buff *skb, struct Qdisc *sch,
 	if (unlikely(len > b->max_skblen))
 		b->max_skblen = len;
 
-	if (skb_is_gso(skb) && q->rate_flags & CAKE_FLAG_SPLIT_GSO) {
+	if (skb_is_gso(skb) && q->split_gso < len ) {
 		struct sk_buff *segs, *nskb;
 		netdev_features_t features = netif_skb_features(skb);
 		unsigned int slen = 0;
@@ -2569,10 +2568,8 @@ 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_SPLIT_GSO;
-	else
-		q->rate_flags &= ~CAKE_FLAG_SPLIT_GSO;
+	if (tb[TCA_CAKE_SPLIT_GSO])
+		q->split_gso = nla_get_u32(tb[TCA_CAKE_SPLIT_GSO]);
 
 	if (q->tins) {
 		sch_tree_lock(sch);
@@ -2611,7 +2608,7 @@ static int cake_init(struct Qdisc *sch, struct nlattr *opt,
 
 	q->cur_tin = 0;
 	q->cur_flow  = 0;
-
+	q->split_gso = ~0; /* always split gso packets */
 	qdisc_watchdog_init(&q->watchdog, sch);
 
 	if (opt) {
@@ -2729,8 +2726,7 @@ static int cake_dump(struct Qdisc *sch, struct sk_buff *skb)
 	if (nla_put_u32(skb, TCA_CAKE_MPU, q->rate_mpu))
 		goto nla_put_failure;
 
-	if (nla_put_u32(skb, TCA_CAKE_SPLIT_GSO,
-			!!(q->rate_flags & CAKE_FLAG_SPLIT_GSO)))
+	if (nla_put_u32(skb, TCA_CAKE_SPLIT_GSO, q->split_gso))
 		goto nla_put_failure;
 
 	return nla_nest_end(skb, opts);

             reply	other threads:[~2018-07-25  4:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-25  4:11 Dave Taht [this message]
2018-07-25  4:32 ` Dave Taht
2018-07-25  4:35   ` Dave Taht
2018-07-25  5:01     ` Dave Taht
2018-07-25 21:03       ` Dave Taht
2018-07-25 21:21         ` Dave Taht

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=CAA93jw6kpexvu3J9WH+FPhWbeOGKEVRp8zXo3po1o82TWX9_oQ@mail.gmail.com \
    --to=dave.taht@gmail.com \
    --cc=cake@lists.bufferbloat.net \
    /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