* [Cake] start at interval handling
@ 2015-10-11 21:30 Dave Taht
2015-10-11 23:47 ` Jonathan Morton
0 siblings, 1 reply; 6+ messages in thread
From: Dave Taht @ 2015-10-11 21:30 UTC (permalink / raw)
To: cake
[-- Attachment #1: Type: text/plain, Size: 327 bytes --]
I couldn't figure out why xstats was a union in the fq_codel code...
or rather, I got interrupted by politics before I did. Am still very
interrupted...
so... anyway, this does start some api breakage, also. Anyone else got
braincells?
--
Dave Täht
Do you want faster, better, wifi? https://www.patreon.com/dtaht
[-- Attachment #2: start_at_interval.patch --]
[-- Type: text/x-patch, Size: 5644 bytes --]
diff --git a/pkt_sched.h b/pkt_sched.h
index 0bacd6e..4c2e7a2 100644
--- a/pkt_sched.h
+++ b/pkt_sched.h
@@ -852,6 +852,19 @@ struct tc_pie_xstats {
};
/* CAKE */
+
+struct tc_cake_cl_stats {
+ __s32 deficit;
+ __u32 count;
+ __u32 dropping;
+ __s32 drop_next;
+};
+
+enum {
+ TCA_CAKE_XSTATS_QDISC,
+ TCA_CAKE_XSTATS_CLASS,
+};
+
enum {
TCA_CAKE_UNSPEC,
TCA_CAKE_BASE_RATE,
diff --git a/sch_cake.c b/sch_cake.c
index a3244f1..a21be68 100644
--- a/sch_cake.c
+++ b/sch_cake.c
@@ -124,7 +124,7 @@ struct cake_bin_data {
u32 flows_cnt; /* number of flows - must be multiple of
* CAKE_SET_WAYS
*/
- u32 perturbation;/* hash perturbation */
+ u32 perturbation; /* hash perturbation */
u16 quantum; /* psched_mtu(qdisc_dev(sch)); */
struct codel_params cparams;
@@ -176,10 +176,10 @@ struct cake_sched_data {
u16 rate_shft;
u64 time_next_packet;
u32 rate_ns;
- u16 peel_threshold;
u32 rate_bps;
u16 rate_flags;
- short rate_overhead;
+ u16 peel_threshold;
+ u16 rate_overhead;
/* resource tracking */
u32 buffer_used;
@@ -191,14 +191,15 @@ struct cake_sched_data {
struct qdisc_watchdog watchdog;
u8 bin_index[64];
+ u32 interval;
};
enum {
- CAKE_MODE_BESTEFFORT = 1,
+ CAKE_MODE_SQUASH,
+ CAKE_MODE_BESTEFFORT,
CAKE_MODE_PRECEDENCE,
CAKE_MODE_DIFFSERV8,
CAKE_MODE_DIFFSERV4,
- CAKE_MODE_SQUASH,
CAKE_MODE_MAX
};
@@ -297,11 +298,10 @@ cake_hash(struct cake_bin_data *q, const struct sk_buff *skb, int flow_mode)
}
host_hash = flow_hash_from_keys(&host_keys);
- if (!(flow_mode & CAKE_FLOW_FLOWS)) {
+ if (!(flow_mode & CAKE_FLOW_FLOWS))
flow_hash = host_hash;
- } else {
+ else
flow_hash = flow_hash_from_keys(&keys);
- }
#endif
reduced_hash = reciprocal_scale(flow_hash, q->flows_cnt);
@@ -781,6 +781,8 @@ static const struct nla_policy cake_policy[TCA_CAKE_MAX + 1] = {
[TCA_CAKE_ATM] = { .type = NLA_U32 },
[TCA_CAKE_FLOW_MODE] = { .type = NLA_U32 },
[TCA_CAKE_OVERHEAD] = { .type = NLA_U32 },
+ [TCA_CAKE_ACTIVE_FLOWS] = { .type = NLA_U32 },
+ [TCA_CAKE_RTT] = { .type = NLA_U32 },
};
static void cake_set_rate(struct cake_bin_data *b, u64 rate, u32 mtu,
@@ -834,7 +836,7 @@ static void cake_config_besteffort(struct Qdisc *sch)
for (i = 0; i < 64; i++)
q->bin_index[i] = 0;
- cake_set_rate(b, rate, mtu, MS2TIME(5), MS2TIME(100));
+ cake_set_rate(b, rate, mtu, MS2TIME(5), q->interval);
b->bin_quantum_band = 65535;
b->bin_quantum_prio = 65535;
}
@@ -857,7 +859,7 @@ static void cake_config_precedence(struct Qdisc *sch)
for (i = 0; i < q->bin_cnt; i++) {
struct cake_bin_data *b = &q->bins[i];
- cake_set_rate(b, rate, mtu, MS2TIME(5), MS2TIME(100));
+ cake_set_rate(b, rate, mtu, MS2TIME(5), q->interval);
b->bin_quantum_prio = max_t(u16, 1U, quantum1);
b->bin_quantum_band = max_t(u16, 1U, quantum2);
@@ -970,7 +972,7 @@ static void cake_config_diffserv8(struct Qdisc *sch)
for (i = 0; i < q->bin_cnt; i++) {
struct cake_bin_data *b = &q->bins[i];
- cake_set_rate(b, rate, mtu, MS2TIME(5), MS2TIME(100));
+ cake_set_rate(b, rate, mtu, MS2TIME(5), q->interval);
b->bin_quantum_prio = max_t(u16, 1U, quantum1);
b->bin_quantum_band = max_t(u16, 1U, quantum2);
@@ -1032,13 +1034,13 @@ static void cake_config_diffserv4(struct Qdisc *sch)
}
/* class characteristics */
- cake_set_rate(&q->bins[0], rate, mtu, MS2TIME(5), MS2TIME(100));
+ cake_set_rate(&q->bins[0], rate, mtu, MS2TIME(5), q->interval);
cake_set_rate(&q->bins[1], rate - (rate >> 4), mtu, MS2TIME(5),
- MS2TIME(100));
+ q->interval);
cake_set_rate(&q->bins[2], rate - (rate >> 2), mtu, MS2TIME(5),
- MS2TIME(100));
+ q->interval);
cake_set_rate(&q->bins[3], rate >> 2, mtu, MS2TIME(5),
- MS2TIME(100));
+ q->interval);
/* priority weights */
q->bins[0].bin_quantum_prio = quantum >> 4;
@@ -1136,6 +1138,9 @@ static int cake_change(struct Qdisc *sch, struct nlattr *opt)
if (tb[TCA_CAKE_OVERHEAD])
q->rate_overhead = nla_get_u32(tb[TCA_CAKE_OVERHEAD]);
+ if (tb[TCA_CAKE_RTT])
+ q->interval = NSEC_PER_USEC * nla_get_u32(tb[TCA_CAKE_RTT]);
+
if (q->bins) {
sch_tree_lock(sch);
cake_reconfigure(sch);
@@ -1271,6 +1276,9 @@ static int cake_dump(struct Qdisc *sch, struct sk_buff *skb)
if (nla_put_u32(skb, TCA_CAKE_OVERHEAD, q->rate_overhead))
goto nla_put_failure;
+ if (nla_put_u32(skb, TCA_CAKE_RTT, codel_time_to_us(q->interval)))
+ goto nla_put_failure;
+
return nla_nest_end(skb, opts);
nla_put_failure:
@@ -1359,12 +1367,11 @@ static int cake_dump_bin(struct Qdisc *sch, unsigned long cl,
static int cake_dump_class_stats(struct Qdisc *sch, unsigned long cl,
struct gnet_dump *d)
{
- /* reuse fq_codel stats format */
struct cake_sched_data *q = qdisc_priv(sch);
struct cake_bin_data *b = q->bins;
u32 bin = 0, idx = cl - 1;
struct gnet_stats_queue qs = {0};
- struct tc_fq_codel_xstats xstats;
+ struct tc_cake_cl_stats xstats;
while (bin < q->bin_cnt && idx >= b->flows_cnt) {
idx -= b->flows_cnt;
@@ -1377,11 +1384,9 @@ static int cake_dump_class_stats(struct Qdisc *sch, unsigned long cl,
const struct sk_buff *skb = flow->head;
memset(&xstats, 0, sizeof(xstats));
- xstats.type = TCA_FQ_CODEL_XSTATS_CLASS;
+ xstats.type = TCA_CAKE_XSTATS_CLASS;
xstats.class_stats.deficit = flow->deficit;
- xstats.class_stats.ldelay = 0;
xstats.class_stats.count = flow->cvars.count;
- xstats.class_stats.lastcount = 0;
xstats.class_stats.dropping = flow->cvars.dropping;
if (flow->cvars.dropping) {
codel_tdiff_t delta = flow->cvars.drop_next -
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Cake] start at interval handling
2015-10-11 21:30 [Cake] start at interval handling Dave Taht
@ 2015-10-11 23:47 ` Jonathan Morton
2015-10-12 7:55 ` Dave Taht
0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Morton @ 2015-10-11 23:47 UTC (permalink / raw)
To: Dave Taht; +Cc: cake
> On 12 Oct, 2015, at 00:30, Dave Taht <dave.taht@gmail.com> wrote:
>
> so... anyway, this does start some api breakage, also. Anyone else got
> braincells?
Some of that is definitely wrong. The rate_overhead parameter needs to be signed, for a start, since some last-mile encapsulations have *less* overhead than Ethernet. That’s why I had it as ‘short’ instead of ‘u16’.
- Jonathan Morton
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Cake] start at interval handling
2015-10-11 23:47 ` Jonathan Morton
@ 2015-10-12 7:55 ` Dave Taht
2015-10-12 8:01 ` Loganaden Velvindron
0 siblings, 1 reply; 6+ messages in thread
From: Dave Taht @ 2015-10-12 7:55 UTC (permalink / raw)
To: Jonathan Morton; +Cc: cake
On Mon, Oct 12, 2015 at 1:47 AM, Jonathan Morton <chromatix99@gmail.com> wrote:
>
>> On 12 Oct, 2015, at 00:30, Dave Taht <dave.taht@gmail.com> wrote:
>>
>> so... anyway, this does start some api breakage, also. Anyone else got
>> braincells?
>
> Some of that is definitely wrong. The rate_overhead parameter needs to be signed, for a start, since some last-mile encapsulations have *less* overhead than Ethernet. That’s why I had it as ‘short’ instead of ‘u16’.
A point being that I am having my life eaten by politics and the rtt
parameter and the dual hash thing, are the only two things left that
need to get done in cake so far as I know.
And it's your code, primarily, and there are plenty of people, willing
to contribute and - especially - help test.
We are one last day, one last big push, away from getting this thing
done. A hackathon with everybody, perhaps, to get there?
>
> - Jonathan Morton
>
--
Dave Täht
Do you want faster, better, wifi? https://www.patreon.com/dtaht
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Cake] start at interval handling
2015-10-12 7:55 ` Dave Taht
@ 2015-10-12 8:01 ` Loganaden Velvindron
2015-10-14 1:50 ` Benjamin Cronce
0 siblings, 1 reply; 6+ messages in thread
From: Loganaden Velvindron @ 2015-10-12 8:01 UTC (permalink / raw)
To: Dave Taht; +Cc: cake
[-- Attachment #1: Type: text/plain, Size: 1379 bytes --]
On Mon, Oct 12, 2015 at 11:55 AM, Dave Taht <dave.taht@gmail.com> wrote:
> On Mon, Oct 12, 2015 at 1:47 AM, Jonathan Morton <chromatix99@gmail.com>
> wrote:
> >
> >> On 12 Oct, 2015, at 00:30, Dave Taht <dave.taht@gmail.com> wrote:
> >>
> >> so... anyway, this does start some api breakage, also. Anyone else got
> >> braincells?
> >
> > Some of that is definitely wrong. The rate_overhead parameter needs to
> be signed, for a start, since some last-mile encapsulations have *less*
> overhead than Ethernet. That’s why I had it as ‘short’ instead of ‘u16’.
>
> A point being that I am having my life eaten by politics and the rtt
> parameter and the dual hash thing, are the only two things left that
> need to get done in cake so far as I know.
>
> And it's your code, primarily, and there are plenty of people, willing
> to contribute and - especially - help test.
>
> We are one last day, one last big push, away from getting this thing
> done. A hackathon with everybody, perhaps, to get there?
>
A hackathon during Saturday & Sunday this week ?
> >
> > - Jonathan Morton
> >
>
>
>
> --
> Dave Täht
> Do you want faster, better, wifi? https://www.patreon.com/dtaht
> _______________________________________________
> Cake mailing list
> Cake@lists.bufferbloat.net
> https://lists.bufferbloat.net/listinfo/cake
>
[-- Attachment #2: Type: text/html, Size: 2355 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Cake] start at interval handling
2015-10-12 8:01 ` Loganaden Velvindron
@ 2015-10-14 1:50 ` Benjamin Cronce
2015-10-14 2:12 ` Dave Taht
0 siblings, 1 reply; 6+ messages in thread
From: Benjamin Cronce @ 2015-10-14 1:50 UTC (permalink / raw)
To: Loganaden Velvindron; +Cc: cake
[-- Attachment #1: Type: text/plain, Size: 1736 bytes --]
I sure hope this makes it into FreeBSD. I use PFSense.
On Mon, Oct 12, 2015 at 3:01 AM, Loganaden Velvindron <loganaden@gmail.com>
wrote:
>
>
> On Mon, Oct 12, 2015 at 11:55 AM, Dave Taht <dave.taht@gmail.com> wrote:
>
>> On Mon, Oct 12, 2015 at 1:47 AM, Jonathan Morton <chromatix99@gmail.com>
>> wrote:
>> >
>> >> On 12 Oct, 2015, at 00:30, Dave Taht <dave.taht@gmail.com> wrote:
>> >>
>> >> so... anyway, this does start some api breakage, also. Anyone else got
>> >> braincells?
>> >
>> > Some of that is definitely wrong. The rate_overhead parameter needs to
>> be signed, for a start, since some last-mile encapsulations have *less*
>> overhead than Ethernet. That’s why I had it as ‘short’ instead of ‘u16’.
>>
>> A point being that I am having my life eaten by politics and the rtt
>> parameter and the dual hash thing, are the only two things left that
>> need to get done in cake so far as I know.
>>
>> And it's your code, primarily, and there are plenty of people, willing
>> to contribute and - especially - help test.
>>
>> We are one last day, one last big push, away from getting this thing
>> done. A hackathon with everybody, perhaps, to get there?
>>
>
> A hackathon during Saturday & Sunday this week ?
>
>
>
>> >
>> > - Jonathan Morton
>> >
>>
>>
>>
>> --
>> Dave Täht
>> Do you want faster, better, wifi? https://www.patreon.com/dtaht
>> _______________________________________________
>> Cake mailing list
>> Cake@lists.bufferbloat.net
>> https://lists.bufferbloat.net/listinfo/cake
>>
>
>
> _______________________________________________
> Cake mailing list
> Cake@lists.bufferbloat.net
> https://lists.bufferbloat.net/listinfo/cake
>
>
[-- Attachment #2: Type: text/html, Size: 3132 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Cake] start at interval handling
2015-10-14 1:50 ` Benjamin Cronce
@ 2015-10-14 2:12 ` Dave Taht
0 siblings, 0 replies; 6+ messages in thread
From: Dave Taht @ 2015-10-14 2:12 UTC (permalink / raw)
To: Benjamin Cronce; +Cc: cake
gotta find a dev for bsd with those chops. been looking for 4 years.
On Wed, Oct 14, 2015 at 3:50 AM, Benjamin Cronce <bcronce@gmail.com> wrote:
> I sure hope this makes it into FreeBSD. I use PFSense.
>
> On Mon, Oct 12, 2015 at 3:01 AM, Loganaden Velvindron <loganaden@gmail.com>
> wrote:
>>
>>
>>
>> On Mon, Oct 12, 2015 at 11:55 AM, Dave Taht <dave.taht@gmail.com> wrote:
>>>
>>> On Mon, Oct 12, 2015 at 1:47 AM, Jonathan Morton <chromatix99@gmail.com>
>>> wrote:
>>> >
>>> >> On 12 Oct, 2015, at 00:30, Dave Taht <dave.taht@gmail.com> wrote:
>>> >>
>>> >> so... anyway, this does start some api breakage, also. Anyone else got
>>> >> braincells?
>>> >
>>> > Some of that is definitely wrong. The rate_overhead parameter needs to
>>> > be signed, for a start, since some last-mile encapsulations have *less*
>>> > overhead than Ethernet. That’s why I had it as ‘short’ instead of ‘u16’.
>>>
>>> A point being that I am having my life eaten by politics and the rtt
>>> parameter and the dual hash thing, are the only two things left that
>>> need to get done in cake so far as I know.
>>>
>>> And it's your code, primarily, and there are plenty of people, willing
>>> to contribute and - especially - help test.
>>>
>>> We are one last day, one last big push, away from getting this thing
>>> done. A hackathon with everybody, perhaps, to get there?
>>
>>
>> A hackathon during Saturday & Sunday this week ?
>>
>>
>>>
>>> >
>>> > - Jonathan Morton
>>> >
>>>
>>>
>>>
>>> --
>>> Dave Täht
>>> Do you want faster, better, wifi? https://www.patreon.com/dtaht
>>> _______________________________________________
>>> Cake mailing list
>>> Cake@lists.bufferbloat.net
>>> https://lists.bufferbloat.net/listinfo/cake
>>
>>
>>
>> _______________________________________________
>> Cake mailing list
>> Cake@lists.bufferbloat.net
>> https://lists.bufferbloat.net/listinfo/cake
>>
>
--
Dave Täht
Do you want faster, better, wifi? https://www.patreon.com/dtaht
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-10-14 2:12 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-11 21:30 [Cake] start at interval handling Dave Taht
2015-10-11 23:47 ` Jonathan Morton
2015-10-12 7:55 ` Dave Taht
2015-10-12 8:01 ` Loganaden Velvindron
2015-10-14 1:50 ` Benjamin Cronce
2015-10-14 2:12 ` Dave Taht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox