From: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
To: Cake List <cake@lists.bufferbloat.net>
Subject: Re: [Cake] Playing with ingredients = ruined the CAKE
Date: Sun, 31 May 2020 10:04:47 +0000 [thread overview]
Message-ID: <2BE61C3D-EED3-405A-A7AF-BA7B7B5B8B03@darbyshire-bryant.me.uk> (raw)
In-Reply-To: <30B03A82-420A-4A9A-899B-8549692AF9DC@darbyshire-bryant.me.uk>
[-- Attachment #1: Type: text/plain, Size: 129 bytes --]
This is currently what I’m playing with:
Cheers,
Kevin D-B
gpg: 012C ACB2 28C6 C53E 9775 9123 B3A2 389B 9DE2 334A
[-- Attachment #2: 0001-experiment-with-diffserv5-incl-an-LE-class.patch --]
[-- Type: application/octet-stream, Size: 5325 bytes --]
From fe1d1fb237aaa8d5728a81707d1c2af6e89aeb23 Mon Sep 17 00:00:00 2001
From: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Date: Wed, 27 May 2020 17:05:51 +0100
Subject: [PATCH] experiment with diffserv5 incl an LE class
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
---
pkt_sched.h | 3 +-
sch_cake.c | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 90 insertions(+), 1 deletion(-)
diff --git a/pkt_sched.h b/pkt_sched.h
index 745cbc7..6d6106a 100644
--- a/pkt_sched.h
+++ b/pkt_sched.h
@@ -947,7 +947,7 @@ enum {
CAKE_FLOW_DUAL_SRC, /* = CAKE_FLOW_SRC_IP | CAKE_FLOW_FLOWS */
CAKE_FLOW_DUAL_DST, /* = CAKE_FLOW_DST_IP | CAKE_FLOW_FLOWS */
CAKE_FLOW_TRIPLE, /* = CAKE_FLOW_HOSTS | CAKE_FLOW_FLOWS */
- CAKE_FLOW_MAX,
+ CAKE_FLOW_MAX
};
enum {
@@ -956,6 +956,7 @@ enum {
CAKE_DIFFSERV_DIFFSERV8,
CAKE_DIFFSERV_BESTEFFORT,
CAKE_DIFFSERV_PRECEDENCE,
+ CAKE_DIFFSERV_DIFFSERV5,
CAKE_DIFFSERV_MAX
};
diff --git a/sch_cake.c b/sch_cake.c
index cb9bbf7..524c5a6 100644
--- a/sch_cake.c
+++ b/sch_cake.c
@@ -333,6 +333,17 @@ static const u8 diffserv8[] = {
7, 2, 2, 2, 2, 2, 2, 2,
};
+static const u8 diffserv5[] = {
+ 0, 1, 0, 0, 3, 0, 0, 0,
+ 2, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 3, 0, 3, 0, 3, 0,
+ 3, 0, 3, 0, 3, 0, 3, 0,
+ 4, 0, 3, 0, 3, 0, 3, 0,
+ 4, 0, 0, 0, 4, 0, 4, 0,
+ 4, 0, 0, 0, 0, 0, 0, 0,
+ 4, 0, 0, 0, 0, 0, 0, 0,
+};
+
static const u8 diffserv4[] = {
0, 1, 0, 0, 2, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0, 0,
@@ -370,6 +381,7 @@ static const u8 besteffort[] = {
static const u8 normal_order[] = {0, 1, 2, 3, 4, 5, 6, 7};
static const u8 bulk_order[] = {1, 0, 2, 3};
+static const u8 le_order[] = {1, 2, 0, 3, 4};
#define REC_INV_SQRT_CACHE (16)
static u32 cobalt_rec_inv_sqrt_cache[REC_INV_SQRT_CACHE] = {0};
@@ -2350,6 +2362,17 @@ static void cake_set_rate(struct cake_tin_data *b, u64 rate, u32 mtu,
b->cparams.p_dec = 1 << 20; /* 1/4096 */
}
+static void cake_config_ingress(struct cake_sched_data *q)
+{
+ u32 i;
+
+ for (i = 1; i < q->tin_cnt ; i++) {
+ q->tins[i].cparams.target = q->tins[0].cparams.target;
+ q->tins[i].cparams.interval = q->tins[0].cparams.interval;
+ q->tins[i].flow_quantum = q->tins[0].flow_quantum;
+ }
+}
+
static int cake_config_besteffort(struct Qdisc *sch)
{
struct cake_sched_data *q = qdisc_priv(sch);
@@ -2397,6 +2420,8 @@ static int cake_config_precedence(struct Qdisc *sch)
quantum *= 7;
quantum >>= 3;
}
+/* if (q->rate_flags & CAKE_FLAG_INGRESS)*/
+ cake_config_ingress(q);
return 0;
}
@@ -2489,6 +2514,58 @@ static int cake_config_diffserv8(struct Qdisc *sch)
quantum *= 7;
quantum >>= 3;
}
+/* if (q->rate_flags & CAKE_FLAG_INGRESS)*/
+ cake_config_ingress(q);
+
+ return 0;
+}
+
+static int cake_config_diffserv5(struct Qdisc *sch)
+{
+/* Further pruned list of traffic classes for four-class system:
+ *
+ * Latency Sensitive (CS7, CS6, EF, VA, CS5, CS4)
+ * Streaming Media (AF4x, AF3x, CS3, AF2x, TOS4, CS2, TOS1)
+ * Background Traffic (CS1)
+ * Best Effort (CS0, AF1x, TOS2, and those not specified)
+ * Least Effort (LE)
+ *
+ * Total 5 traffic classes.
+ */
+
+ struct cake_sched_data *q = qdisc_priv(sch);
+ u32 mtu = psched_mtu(qdisc_dev(sch));
+ u64 rate = q->rate_bps;
+ u32 quantum = 1024;
+ u32 i;
+
+ q->tin_cnt = 5;
+
+ /* codepoint to class mapping */
+ q->tin_index = diffserv5;
+ q->tin_order = le_order;
+
+ /* class characteristics */
+ cake_set_rate(&q->tins[0], rate, mtu,
+ us_to_ns(q->target), us_to_ns(q->interval));
+ cake_set_rate(&q->tins[1], rate >> 8, mtu,
+ us_to_ns(q->target), us_to_ns(q->interval));
+ cake_set_rate(&q->tins[2], rate >> 4, mtu,
+ us_to_ns(q->target), us_to_ns(q->interval));
+ cake_set_rate(&q->tins[3], rate >> 1, mtu,
+ us_to_ns(q->target), us_to_ns(q->interval));
+ cake_set_rate(&q->tins[4], rate >> 2, mtu,
+ us_to_ns(q->target), us_to_ns(q->interval));
+
+ /* bandwidth-sharing weights */
+ q->tins[0].tin_quantum = quantum; /*BE*/
+ q->tins[1].tin_quantum = quantum >> 8; /*LE*/
+ q->tins[2].tin_quantum = quantum >> 4; /*BK*/
+ q->tins[3].tin_quantum = quantum >> 1; /*VI*/
+ q->tins[4].tin_quantum = quantum >> 2; /*VO*/
+
+/* if (q->rate_flags & CAKE_FLAG_INGRESS)*/
+ cake_config_ingress(q);
return 0;
}
@@ -2509,6 +2586,7 @@ static int cake_config_diffserv4(struct Qdisc *sch)
u32 mtu = psched_mtu(qdisc_dev(sch));
u64 rate = q->rate_bps;
u32 quantum = 1024;
+ u32 i;
q->tin_cnt = 4;
@@ -2532,6 +2610,9 @@ static int cake_config_diffserv4(struct Qdisc *sch)
q->tins[2].tin_quantum = quantum >> 1;
q->tins[3].tin_quantum = quantum >> 2;
+/* if (q->rate_flags & CAKE_FLAG_INGRESS)*/
+ cake_config_ingress(q);
+
return 0;
}
@@ -2566,6 +2647,9 @@ static int cake_config_diffserv3(struct Qdisc *sch)
q->tins[1].tin_quantum = quantum >> 4;
q->tins[2].tin_quantum = quantum >> 2;
+/* if (q->rate_flags & CAKE_FLAG_INGRESS)*/
+ cake_config_ingress(q);
+
return 0;
}
@@ -2587,6 +2671,10 @@ static void cake_reconfigure(struct Qdisc *sch)
ft = cake_config_diffserv8(sch);
break;
+ case CAKE_DIFFSERV_DIFFSERV5:
+ ft = cake_config_diffserv5(sch);
+ break;
+
case CAKE_DIFFSERV_DIFFSERV4:
ft = cake_config_diffserv4(sch);
break;
--
2.24.3 (Apple Git-128)
next prev parent reply other threads:[~2020-05-31 10:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-29 10:06 Kevin Darbyshire-Bryant
2020-05-29 15:24 ` Kevin Darbyshire-Bryant
2020-05-31 10:04 ` Kevin Darbyshire-Bryant [this message]
2020-05-31 16:38 ` John Yates
2020-05-31 17:08 ` Kevin Darbyshire-Bryant
2020-05-31 17:26 ` John Yates
2020-05-31 18:08 ` Kevin Darbyshire-Bryant
2020-05-31 19:01 ` Dave Taht
2020-05-31 19:25 ` Sebastian Moeller
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=2BE61C3D-EED3-405A-A7AF-BA7B7B5B8B03@darbyshire-bryant.me.uk \
--to=kevin@darbyshire-bryant.me.uk \
--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