* [Cake] Query regarding COBALT implementation in CAKE
@ 2019-01-22 8:29 Shefali Gupta
2019-01-22 9:04 ` Jonathan Morton
0 siblings, 1 reply; 3+ messages in thread
From: Shefali Gupta @ 2019-01-22 8:29 UTC (permalink / raw)
To: Cake List
[-- Attachment #1: Type: text/plain, Size: 406 bytes --]
Hello Jonathan and Dave,
We were trying to look into Linux Kernel CAKE code to understand COBALT
implementation.
We are unable to understand how over_target variable is being used to
change the dropping state, on the line number 535 of CAKE code.
We are referring to this CAKE code:
https://elixir.bootlin.com/linux/latest/source/net/sched/sch_cake.c
Thanks and regards,
Shefali Gupta
Jendaipou Palmei
[-- Attachment #2: Type: text/html, Size: 968 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Cake] Query regarding COBALT implementation in CAKE
2019-01-22 8:29 [Cake] Query regarding COBALT implementation in CAKE Shefali Gupta
@ 2019-01-22 9:04 ` Jonathan Morton
2019-01-22 9:12 ` Jonathan Morton
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Morton @ 2019-01-22 9:04 UTC (permalink / raw)
To: Shefali Gupta; +Cc: Cake List
> On 22 Jan, 2019, at 10:29 am, Shefali Gupta <shefaligups11@gmail.com> wrote:
>
> We are unable to understand how over_target variable is being used to change the dropping state, on the line number 535 of CAKE code.
A little earlier in the code, you can see how over_target is calculated. It's simply a boolean decision:
over_target = sojourn > p->target &&
sojourn > p->mtu_time * bulk_flows * 2 &&
sojourn > p->mtu_time * 4;
There are three decision terms, all of which compare the sojourn time of the current packet to some threshold, and all of which must be true for over_target to be true, and thus for the Codel logic to enter dropping state. In principle, it could be replaced by "sojourn > min(p->target, p_mtu_time * min(4, bulk_flows * 2))", but that would be harder to lay out readably in the Linux kernel's 80-column style.
The middle term is not relevant for your implementation, because you have a single-queue version of COBALT; you could consider bulk_flows as being fixed at 1, so that term is always true when the last term is true.
The last term depends on p->mtu_time which is initialised whenever Cake's shaper is reconfigured. It refers to the time required to stuff an MTU-sized packet down the pipe. Since your implementation is not closely integrated with a shaper and therefore you don't have an easy way to calculate mtu_time, you may eliminate this term, and instead manually configure the target to satisfy the same criterion.
You can therefore simplify if(over_target) to if(sojourn > p->target) for your purposes.
- Jonathan Morton
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-01-22 9:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-22 8:29 [Cake] Query regarding COBALT implementation in CAKE Shefali Gupta
2019-01-22 9:04 ` Jonathan Morton
2019-01-22 9:12 ` Jonathan Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox