Coder Social home page Coder Social logo

sch_cake's Introduction

Common Applications Kept Enhanced (CAKE) scheduler

This is the out-of-tree version of CAKE, the Linux qdisc that combines scheduler and traffic shaper for effective bufferbloat mitigation.

Note that sch_cake is part of the upstream Linux kernel since kernel version 4.19, so this repository exists only as a resource for building the qdisc with older versions of the kernel. If you’re already on kernel 4.19 or newer, you can just load CAKE with tc and the kernel shipped by your distribution!

sch_cake's People

Contributors

chromi avatar dtaht avatar gamanakis avatar guidosarducci avatar heistp avatar inste avatar ldir-edb0 avatar lochnair avatar moeller0 avatar nvmmax avatar p00ya avatar rmounce avatar taskset avatar tohojo avatar vic063 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sch_cake's Issues

immediate kernel hang with cobalt branch

recently tried updating cake to latest on kernel 4.10.4 on arch linux
and as soon as the module is put to use I get a hang on the system and have to force reset
I've checked logs and see nothing, while shelled in to physical machine terminal also hangs
didn't see full dump from when ssh'd into it but looked like it mentioned cake_dequeue
I didn't take a picture since it was not a full trace
last stable i had was from 15 days ago

at this time testing for fixes will be delayed a day or 2

Cant compile on 4.5.4

Hi everyone,

Im getting the following during make:

make -C /lib/modules/4.5.4ll/build SUBDIRS=/array0/zcecc22/projects/sch_cake modules LDFLAGS_MODULE="--build-id=0x4471e48a55ac41e1caaeab74ed3278fa1d461e4a" CFLAGS_MODULE="-DCAKE_VERSION=\"4471e48a55ac41e1caaeab74ed3278fa1d461e4a\""
make[1]: Entering directory '/array0/zcecc22/projects/linux-4.5.4'
CC [M] /array0/zcecc22/projects/sch_cake/sch_cake.o
/array0/zcecc22/projects/sch_cake/sch_cake.c: In function ‘cake_enqueue’:
/array0/zcecc22/projects/sch_cake/sch_cake.c:728:3: error: implicit declaration of function ‘qdisc_tree_reduce_backlog’ [-Werror=implicit-function-declaration]
qdisc_tree_reduce_backlog(sch, 1, len);
^
cc1: some warnings being treated as errors

Can't unload act_mirred/sch_cake

Hi! Is there a trick how one can get the act_mirred & sch_cake modules unloaded? Not even rmmod --force will work and I can't figure out what exactly is still using them. Various invocations of tc qdisc del never manage to actually del anything, either. Removing the interface (ip link del dev) does work but isn't enough in getting the modules unloaded.

DKMS build error on 4.13

This is a patched kernel, however the patches were previously applied on 4.12 with no problems to the dkms build.

DKMS make.log for sch_cake-r266.e641a56 for kernel 4.13.0-2-bfq-mq (x86_64)
Tue Sep  5 02:18:20 +07 2017
make: Entering directory '/usr/lib/modules/4.13.0-2-bfq-mq/build'
  AR      /var/lib/dkms/sch_cake/r266.e641a56/build/built-in.o
  CC [M]  /var/lib/dkms/sch_cake/r266.e641a56/build/sch_cake.o
/var/lib/dkms/sch_cake/r266.e641a56/build/sch_cake.c:2074:3: error: ‘const struct Qdisc_class_ops’ has no member named ‘tcf_chain’
  .tcf_chain = cake_find_tcf,
   ^~~~~~~~~
/var/lib/dkms/sch_cake/r266.e641a56/build/sch_cake.c:2074:15: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  .tcf_chain = cake_find_tcf,
               ^~~~~~~~~~~~~
/var/lib/dkms/sch_cake/r266.e641a56/build/sch_cake.c:2074:15: note: (near initialization for ‘cake_class_ops.change’)
cc1: some warnings being treated as errors
make[1]: *** [scripts/Makefile.build:309: /var/lib/dkms/sch_cake/r266.e641a56/build/sch_cake.o] Error 1
make: *** [Makefile:1512: _module_/var/lib/dkms/sch_cake/r266.e641a56/build] Error 2
make: Leaving directory '/usr/lib/modules/4.13.0-2-bfq-mq/build'

question about diffserv4 tin thresholds

Specifically this commit:
423112e

I set QoS with "tc qdisc replace dev eth1 root cake diffserv4 flows
bandwidth 100mbit"

In an older version of Cake:
------------------------------------------------
capacity estimate: 100Mbit
Tin 0 Tin 1 Tin 2 Tin 3
thresh 100Mbit 93750Kbit 75Mbit 25Mbit
target 5.0ms 5.0ms 5.0ms 5.0ms
interval 100.0ms 100.0ms 100.0ms 100.0ms
------------------------------------------------

and with the more recent one:
------------------------------------------------
capacity estimate: 100Mbit
Bulk Best Effort Video Voice
thresh 6250Kbit 100Mbit 50Mbit 25Mbit
target 5.0ms 5.0ms 5.0ms 5.0ms
interval 100.0ms 100.0ms 100.0ms 100.0ms
------------------------------------------------

The questions:

  • why did tin2 threshold reduce from 75% to 50% ?
  • why did tin1 threshold change from 15/16 to 100% ?
  • i'm assuming that tin0's may be residual 1/16 of 100 mbit ? ; maybe
    tin1 should show 15/16 of 100mbit ?

It may be a reporting issue, or not.
I'm trying to understand the change, and how to handle it internally :)
But, the current situation does not match what's mentioned here:
https://www.bufferbloat.net/projects/codel/wiki/CakeTechnical/#priority-queue

Thanks
Alex

diffserv-llt

There is of course, no guaruntee that these new codepoints will get through the ietf. I should also go looking for any suggestions of a "LE" least effort codepoint or other historical codepoints we do not map.

I am curious however, if it makes sense to add support for Lo/La across all of cake's diffserv models, if they don't already map?

Error when compiling

When cross-compiling for the EdgeRouter Lite using the Cavium SDK (3.1), I get the following error.

lochnair@debianbuild:~/edgeos/sch_cake$ ARCH=mips CROSS_COMPILE=mips64-octeon-linux-gnu- make
make -C ../linux-src/linux-3.10/kernel/ SUBDIRS=/home/lochnair/edgeos/sch_cake modules LDFLAGS_MODULE="--build-id=0x417e6b97179c02996dabfccd87e9317f21037d6d" CFLAGS_MODULE="-DCAKE_VERSION=\\\"417e6b97179c02996dabfccd87e9317f21037d6d\\\""
make[1]: Entering directory `/home/lochnair/edgeos/linux-src/linux-3.10/kernel'
  CC [M]  /home/lochnair/edgeos/sch_cake/sch_cake.o
In file included from /home/lochnair/edgeos/sch_cake/cobalt.c:50:0,
                 from /home/lochnair/edgeos/sch_cake/sch_cake.c:59:
/home/lochnair/edgeos/sch_cake/cobalt.h: In function 'cobalt_get_time':
/home/lochnair/edgeos/sch_cake/cobalt.h:64:2: error: implicit declaration of function 'ktime_get_ns' [-Werror=implicit-function-declaration]
In file included from /home/lochnair/edgeos/sch_cake/cobalt.c:60:0,
                 from /home/lochnair/edgeos/sch_cake/sch_cake.c:59:
/home/lochnair/edgeos/sch_cake/codel5_compat.h: At top level:
/home/lochnair/edgeos/sch_cake/codel5_compat.h:53:0: warning: "codel_stats_copy_queue" redefined [enabled by default]
In file included from /home/lochnair/edgeos/sch_cake/cobalt.c:50:0,
                 from /home/lochnair/edgeos/sch_cake/sch_cake.c:59:
/home/lochnair/edgeos/sch_cake/cobalt.h:58:0: note: this is the location of the previous definition
In file included from /home/lochnair/edgeos/sch_cake/cobalt.c:60:0,
                 from /home/lochnair/edgeos/sch_cake/sch_cake.c:59:
/home/lochnair/edgeos/sch_cake/codel5_compat.h:54:0: warning: "codel_watchdog_schedule_ns" redefined [enabled by default]
In file included from /home/lochnair/edgeos/sch_cake/cobalt.c:50:0,
                 from /home/lochnair/edgeos/sch_cake/sch_cake.c:59:
/home/lochnair/edgeos/sch_cake/cobalt.h:59:0: note: this is the location of the previous definition
cc1: some warnings being treated as errors
make[2]: *** [/home/lochnair/edgeos/sch_cake/sch_cake.o] Error 1
make[1]: *** [_module_/home/lochnair/edgeos/sch_cake] Error 2
make[1]: Leaving directory `/home/lochnair/edgeos/linux-src/linux-3.10/kernel'
make: *** [default] Error 2

It complains about this code. As I understand this function (ktime_get_ns) is not available on this kernel version.

static inline cobalt_time_t cobalt_get_time(void)
{
    return ktime_get_ns();
}

Looking further I found that codel5_compat.h defines this function for older kernels, but it doesn't work:

#if KERNEL_VERSION(3, 17, 0) > LINUX_VERSION_CODE

#define ktime_get_ns() ktime_to_ns(ktime_get())

#endif

So for the sake of testing I changed the cobalt_get_time function to use the old method:

static inline cobalt_time_t cobalt_get_time(void)
{
    return ktime_to_ns(ktime_get());
}

Now it compiles with no errors. As far as I can understand with my limited C knowledge, the order the headers are included is wrong, but I have no idea how to fix that.

Bandwidth limiter not working

On my machine, the bandwidth limiter is currently non-operational. I'm not quite sure what leads to this issue, though.

I'm running Arch Linux with the LTS kernel (4.14.68) and using the AUR package iproute2-cake (r4242.a55119d1-1) and sch_cake-dkms (r472.eb15399-1).

When I use the man page example

tc qdisc add root dev eth0 cake bandwidth 100Mbit ethernet

or any other parameter I tried, the capacity estimate is always at 6755Tbit - which makes no sense to me.

I'm not sure how to debug this, but I let the machine running in this state (maybe a reboot would fix this?)

sqm mode

I would like a 3 tin shaper more exactly equivalent to how sqm works today on fq_codel. My measurements showed that we spend a significant amount of cpu searching through 4 tins, and I have yet to have seen any real advantage to having more than 3.

Add license

I'd like to package sch_cake as an RPM on RPMFusion for Fedora but without a license attributed to this project it will be difficult. I realize there is a license on the tc-adv repo but it's a bit of a weak reference and would really help out if the license was also added to this repo.

Cake classification, classification of ingress

I'd like to raise this issue again (see #14 and possibly several others).
Without classes, how would you classify incoming packets (where all you can do is restore the connmark with tc action connmark) through an ifb device (see tc action mirred) into "classes" that cake understands?
Currently, this is impossible.

This makes sense because while you can typically control the dscp values of the packets you're sending (and use iptables to connmark those connections), it is not so easy to control incoming packets.

Imagine you have different applications that produce lots of bulk traffic. Not all of them even have the feature to set dscp values.
Much worse however is when the much higher traffic incoming traffic has no dscp value anyway. This results in bulk being mixed with best effort.

There's one workaround I'm aware of that makes this work but it is ugly as instead of the ifb it requires an extra interface, extra qdiscs, etc.

The argument I heard against proper tc classes is simplicity, but this is a bad argument because the average Joe has no clue what dscp is. Also, depending on the application setting a custom dscp value is hard to impossible for the average Joe.

Proper tc classes would make using cake much simpler. Instead of trying to configure applications to send the right dscp or do workarounds, the user could classify based on anything that iptables can do (made arbitrarily simple through router configuration interface).
Iptables would simply connmark and tc would classify based on these fwmarks in both directions, ingress and egress.

4.5.0-rc7 issue with sch_cake

make[1]: Entering directory '/home/d/git/linux/tim'
CC [M] /home/d/git/sch_cake/sch_cake.o
/home/d/git/sch_cake/sch_cake.c: In function ‘cake_enqueue’:
/home/d/git/sch_cake/sch_cake.c:662:3: error: implicit declaration of function ‘qdisc_tree_reduce_backlog’ [-Werror=implicit-function-declaration]
qdisc_tree_reduce_backlog(sch, 1, len);

Limiter does not calc right on ingress devices

I might be doing something wrong, but in my setup today I discovered that cake might double the actually used datarate on the ingress device and accordingly shaping everything ingressing to the device to the half of the configured limiter.

Like

tc qdisc add dev ifb0 root cake bandwidth 50mbit

Would limit the device which has attached ifb0 to something around 25mbit.

If appropriate I might provide some sample configs. :)

Licence info missing

Currently cake taints the kernel because a licence is missing...

sch_cake: module license 'unspecified' taints kernel

the new cake man page

I like it. However I think some explanatory text about how cake's shaping feature is not needed when running at line rate should be added. Something like "Cake can be applied at line rate, without shaping, and so long as there is something like BQL on the underlying device, it can effectively apply the various fq modes and classification to traffic, with much lower overhead than shaping costs. You can even make cake the default qdisc via a sysctl"

It seems kvfree() is available from 3.15 onward, I needed the change below to compile under opensuse13.2 and ubuntu 14.04, maybe this is required generally?

commit d6a0463769b59e9f3571c6eb59139bae818e0d6a
Author: Sebastian Moeller [email protected]
Date: Thu Jul 23 14:53:53 2015 +0200

[sch_cake] kvfree seems reachable for linux kernels >= 3.15

Signed-off-by: Sebastian Moeller <[email protected]>

diff --git a/codel5.h b/codel5.h
index 0e1509c..41dacc9 100644
--- a/codel5.h
+++ b/codel5.h
@@ -67,6 +67,16 @@ static inline u32 reciprocal_scale(u32 val, u32 ep_ro)
return (u32)(((u64) val * ep_ro) >> 32);
}

+static inline void kvfree(const void *addr)
+{

  • if (is_vmalloc_addr(addr))
  • vfree(addr);
  • else
  • kfree(addr);
    +}

endif

if LINUX_VERSION_CODE <= KERNEL_VERSION(3,17,0)

@@ -98,14 +108,6 @@ static inline void qdisc_qstats_drop(struct Qdisc *sch)
sch->qstats.drops++;
}

-static inline void kvfree(const void *addr)
-{

  • if (is_vmalloc_addr(addr))
  • vfree(addr);
  • else
  • kfree(addr);
    -}

#define codel_stats_copy_queue(a,b,c,d) gnet_stats_copy_queue(a,c)
#define codel_watchdog_schedule_ns(a,b,c) qdisc_watchdog_schedule_ns(a,b)
#else

P.S.: Not sure whether this is the right way to propose this change...

Won't compile on openwrt

Don't have the time to look into it, but I get the following error trying to compile the latest cake on openwrt trunk for the Archer C7v2:
/tmp/openwrt/build_dir/target-mips_34kc_musl-1.1.11/linux-ar71xx_generic/sched-cake-2015-git/codel5.h:62:27: fatal error: codel5_compat.h: No such file or directory

sqm mode

I really think a three tier sqm mode is enough. More complexity is generally not needed.

Cake for multi pppoe and ip to ip shaper

Hi
I try to use cake in test system with

eth0 - uplink Interne
eth1 - customer (with dhcp and static ips) on bridge with 4 vlans
eth2 - pppoe cuscome (20 users)

eth0 - have real ip

eth1 and eth2 (pppoe) have 192.168.x.x/x

And i have 3 speed class

3mbit/3mbit (Up/Down)
7mbit/7mbit (Up/Down)
10mbit/10mbit (Up/Down)

i what to work with cake and shape upload/download from to users
Cake not support classid and this stop my test

i try to replace imq/ifb with cake for more stable networking

Any help ?

Thanks

cake classes

Hi,
is it feasible to access cake's classes using tc filter?
I want to set dscp bit on ingress but this is not feasible, so an alternative would be to access cake's classes so I classify donwstream properly.

A little better spacing seems feasible on the tc output

See bytes column below.

tc -s qdisc show dev enp2s0
qdisc cake 8011: root refcnt 9 bandwidth 250Mbit diffserv3 triple-isolate rtt 100.0ms raw 
 Sent 144951532646 bytes 129483888 pkt (dropped 596852, overlimits 37943139 requeues 214633) 
 backlog 0b 0p requeues 214633 
 memory used: 2452168b of 12500000b
 capacity estimate: 0bit
                 Bulk   Best Effort      Voice
  thresh     15625Kbit     250Mbit   62500Kbit
  target         5.0ms       5.0ms       5.0ms
  interval     100.0ms     100.0ms      10.0ms
  pk_delay        14us       3.1ms        61us
  av_delay         3us       2.3ms         9us
  sp_delay         2us         5us         4us
  pkts         3537947    91217185     7096320
  bytes     3075970079103122930562  8136391361
  way_inds           0      458354           0
  way_miss          21        6431          27
  way_cols           0           0           0
  drops          48427      528949       19476
  marks              0           0           0
  sp_flows           1           6           1
  bk_flows           0           0           0
  un_flows           0           0           0
  max_len        62074       54504       62074

Adding cake qdisc on ppp0 gives immediate page allocation failure

I'm in the very early stages of playing with cake so I'm probably doing something daft...

uname -a: Linux little 4.9.0-6-marvell #1 Debian 4.9.88-1+deb9u1 (2018-05-07) armv5tel GNU/Linux
commit: 0520a6c

The sch_cake module loads fine, but this command results in an immediate stack trace:

tc qdisc add dev ppp0 root cake

It doesn't crash the system and the qdisc seems to have been added at least to some extent (edited to show output from recent tc):

root@little:~# tc qdisc show dev ppp0
qdisc cake 8008: root refcnt 2 (?autorate?) (?diffserv?) flowblind noatm overhead 7

Here's the trace:

Jul 05 11:00:29 little kernel: tc: page allocation failure: order:8, mode:0x26040c0(GFP_KERNEL|__GFP_COMP|__GFP_NOTRACK)
Jul 05 11:00:29 little kernel: CPU: 0 PID: 10667 Comm: tc Tainted: G           O    4.9.0-6-marvell #1 Debian 4.9.88-1+deb9u1
Jul 05 11:00:29 little kernel: Hardware name: Marvell Kirkwood (Flattened Device Tree)
Jul 05 11:00:29 little kernel: [<c0015fe8>] (unwind_backtrace) from [<c00130a0>] (show_stack+0x18/0x1c)
Jul 05 11:00:29 little kernel: [<c00130a0>] (show_stack) from [<c00db8c8>] (warn_alloc+0xe4/0x118)
Jul 05 11:00:29 little kernel: [<c00db8c8>] (warn_alloc) from [<c00dc2c4>] (__alloc_pages_nodemask+0x940/0xa5c)
Jul 05 11:00:29 little kernel: [<c00dc2c4>] (__alloc_pages_nodemask) from [<c010f1bc>] (cache_alloc_refill+0x280/0x808)
Jul 05 11:00:29 little kernel: [<c010f1bc>] (cache_alloc_refill) from [<c010fa74>] (kmem_cache_alloc_trace+0xc8/0x12c)
Jul 05 11:00:29 little kernel: [<c010fa74>] (kmem_cache_alloc_trace) from [<bf0f1f88>] (cake_init+0x124/0x310 [sch_cake])
Jul 05 11:00:29 little kernel: [<bf0f1f88>] (cake_init [sch_cake]) from [<c0332274>] (qdisc_create+0x120/0x368)
Jul 05 11:00:29 little kernel: [<c0332274>] (qdisc_create) from [<c033281c>] (tc_modify_qdisc+0x360/0x49c)
Jul 05 11:00:29 little kernel: [<c033281c>] (tc_modify_qdisc) from [<c031e0fc>] (rtnetlink_rcv_msg+0xc0/0x1bc)
Jul 05 11:00:29 little kernel: [<c031e0fc>] (rtnetlink_rcv_msg) from [<c0339ee0>] (netlink_rcv_skb+0x64/0xb8)
Jul 05 11:00:29 little kernel: [<c0339ee0>] (netlink_rcv_skb) from [<c031b65c>] (rtnetlink_rcv+0x20/0x2c)
Jul 05 11:00:29 little kernel: [<c031b65c>] (rtnetlink_rcv) from [<c03398a0>] (netlink_unicast+0x148/0x200)
Jul 05 11:00:29 little kernel: [<c03398a0>] (netlink_unicast) from [<c0339d34>] (netlink_sendmsg+0x31c/0x340)
Jul 05 11:00:29 little kernel: [<c0339d34>] (netlink_sendmsg) from [<c02ef398>] (sock_sendmsg+0x3c/0x50)
Jul 05 11:00:29 little kernel: [<c02ef398>] (sock_sendmsg) from [<c02efd54>] (___sys_sendmsg+0x1f4/0x240)
Jul 05 11:00:29 little kernel: [<c02efd54>] (___sys_sendmsg) from [<c02f0bf0>] (__sys_sendmsg+0x48/0x6c)
Jul 05 11:00:29 little kernel: [<c02f0bf0>] (__sys_sendmsg) from [<c000f560>] (ret_fast_syscall+0x0/0x44)
Jul 05 11:00:29 little kernel: Mem-Info:
Jul 05 11:00:29 little kernel: active_anon:43073 inactive_anon:595 isolated_anon:0
                                active_file:12291 inactive_file:10960 isolated_file:0
                                unevictable:1751 dirty:19 writeback:0 unstable:0
                                slab_reclaimable:5105 slab_unreclaimable:1872
                                mapped:6008 shmem:1609 pagetables:581 bounce:0
                                free:50674 free_pcp:0 free_cma:0
Jul 05 11:00:29 little kernel: Node 0 active_anon:172292kB inactive_anon:2380kB active_file:49164kB inactive_file:43840kB unevictable:7004kB isolated(anon):0kB isolated(file):0kB mapped:24032kB dirty:76kB writeback:0kB shmem:6436kB writeback_tmp:0kB unstable:0kB pages_scanned:0 all_unreclaimable? no
Jul 05 11:00:29 little kernel: Normal free:202696kB min:2828kB low:3532kB high:4236kB active_anon:172292kB inactive_anon:2380kB active_file:49164kB inactive_file:43840kB unevictable:7004kB writepending:76kB present:524288kB managed:513976kB mlocked:7004kB slab_reclaimable:20420kB slab_unreclaimable:7488kB kernel_stack:848kB pagetables:2324kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
Jul 05 11:00:29 little kernel: lowmem_reserve[]: 0 0 0
Jul 05 11:00:29 little kernel: Normal: 12048*4kB (UME) 10893*8kB (UME) 3294*16kB (UME) 424*32kB (UME) 17*64kB (UME) 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 202696kB
Jul 05 11:00:29 little kernel: 25532 total pagecache pages
Jul 05 11:00:29 little kernel: 0 pages in swap cache
Jul 05 11:00:29 little kernel: Swap cache stats: add 0, delete 0, find 0/0
Jul 05 11:00:29 little kernel: Free swap  = 0kB
Jul 05 11:00:29 little kernel: Total swap = 0kB
Jul 05 11:00:29 little kernel: 131072 pages RAM
Jul 05 11:00:29 little kernel: 0 pages HighMem/MovableOnly
Jul 05 11:00:29 little kernel: 2578 pages reserved

What is tin_quantum_prio used for? Looks unused

As per the title I can't find any code that actually uses the tin_quantum_prio variable.

I can find tin_quantum_band used in the tin selection algorithm. We go to some effort to set tin_quantum_prio but I can't find where it's used.

New instability with the instability fix

Hi Jonathan,

This is early warning, I've no further info beyond bba7b53 caused my router to stop responding to pings, even on local lan very shortly after boot. It hadn't crashed as heartbeat still going but something was up. It could be a dodgy build or anything really. Unfortunately I'm just off to work so had to quickly revert before dashing out the door.

Kevin

improving the ack-filter

@rmounce

I haven't got around to re-testing the final ack-filter code, but in my original tests ( http://blog.cerowrt.org/post/ack_filtering/ ) I'd felt that if all the ack drops counted towards the
DRR deficit, all 4 (instead of just one) flows would grow towards optimum faster as you'd
accumulate more acks to filter on each round.

I figure everyone's relaxed and enjoying summer, but I just wanted to write this idea down somewhere before I forgot it again.

Question about memory

I've set up a custom router running on an old Intel pc. It has a lot of memory (16Gb).

Are there settings I can make to the config/scripts to take advantage of the extra memory? Or is that all done at the tc-adv level?

ethernet option and mpu

I have no idea what the new ethernet option is supposed to be doing... it sets mpu to 84??
And overhead??

root@dancer:~/git/sch_cake# tc qdisc show dev eno1
qdisc cake 8008: root refcnt 2 bandwidth 100Mbit diffserv3 triple-isolate rtt 100.0ms noatm overhead 38 via-ethernet mpu 84

Fails to build with Jessie's 3.16

Hi,

Current cobalt fails to build on Debian Jessie's 3.16:

$ make
make -C /lib/modules/3.16.0-5-586/build SUBDIRS=/usr/src/sch_cake.orig modules LDFLAGS_MODULE="--build-id=0x115af5dcec46f82180fcea7adac2fe743bad98d9" CFLAGS_MODULE="-DCAKE_VERSION=\\\"115af5dcec46f82180fcea7adac2fe743bad98d9\\\""
make[1]: Entering directory '/usr/src/linux-headers-3.16.0-5-586'
make[1]: Entering directory `/usr/src/linux-headers-3.16.0-5-586'
  CC [M]  /usr/src/sch_cake.orig/sch_cake.o
In file included from /usr/src/sch_cake.orig/sch_cake.c:76:0:
/usr/src/sch_cake.orig/cobalt.h:162:27: warning: "__is_defined" is not defined [-Wundef]
     (IS_MODULE(option) && __is_defined(MODULE)))
                           ^
/usr/src/sch_cake.orig/sch_cake.c:78:5: note: in expansion of macro ‘IS_REACHABLE’
 #if IS_REACHABLE(CONFIG_NF_CONNTRACK)
     ^
/usr/src/sch_cake.orig/cobalt.h:162:39: error: missing binary operator before token "("
     (IS_MODULE(option) && __is_defined(MODULE)))
                                       ^
/usr/src/sch_cake.orig/sch_cake.c:78:5: note: in expansion of macro ‘IS_REACHABLE’
 #if IS_REACHABLE(CONFIG_NF_CONNTRACK)
     ^
/usr/src/sch_cake.orig/cobalt.h:162:27: warning: "__is_defined" is not defined [-Wundef]
     (IS_MODULE(option) && __is_defined(MODULE)))
                           ^
/usr/src/sch_cake.orig/sch_cake.c:528:5: note: in expansion of macro ‘IS_REACHABLE’
 #if IS_REACHABLE(CONFIG_NF_CONNTRACK)
     ^
/usr/src/sch_cake.orig/cobalt.h:162:39: error: missing binary operator before token "("
     (IS_MODULE(option) && __is_defined(MODULE)))
                                       ^
/usr/src/sch_cake.orig/sch_cake.c:528:5: note: in expansion of macro ‘IS_REACHABLE’
 #if IS_REACHABLE(CONFIG_NF_CONNTRACK)
     ^
/usr/src/sch_cake.orig/sch_cake.c: In function ‘cake_get_tcphdr’:
/usr/src/sch_cake.orig/sch_cake.c:925:7: error: implicit declaration of function ‘__tcp_hdrlen’ [-Werror=implicit-function-declaration]
       min(__tcp_hdrlen(tcph), bufsize), buf);
       ^
In file included from /usr/src/linux-headers-3.16.0-5-common/arch/x86/include/asm/percpu.h:44:0,
                 from /usr/src/linux-headers-3.16.0-5-common/arch/x86/include/asm/preempt.h:5,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/preempt.h:18,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/spinlock.h:50,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/seqlock.h:35,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/time.h:5,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/stat.h:18,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/module.h:10,
                 from /usr/src/sch_cake.orig/sch_cake.c:53:
/usr/src/linux-headers-3.16.0-5-common/include/linux/kernel.h:716:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
  (void) (&_min1 == &_min2);  \
                 ^
/usr/src/sch_cake.orig/sch_cake.c:925:7: note: in expansion of macro ‘min’
       min(__tcp_hdrlen(tcph), bufsize), buf);
       ^
/usr/src/sch_cake.orig/sch_cake.c: In function ‘cake_ack_filter’:
/usr/src/sch_cake.orig/sch_cake.c:1026:1: error: ‘n’ undeclared (first use in this function)
 n
 ^
/usr/src/sch_cake.orig/sch_cake.c:1026:1: note: each undeclared identifier is reported only once for each function it appears in
/usr/src/sch_cake.orig/sch_cake.c:1039:3: error: expected ‘;’ before ‘if’
   if (((tcp_flag_word(tcph_check) &
   ^
/usr/src/sch_cake.orig/sch_cake.c: In function ‘cake_drop’:
/usr/src/sch_cake.orig/sch_cake.c:1318:2: error: implicit declaration of function ‘qdisc_tree_decrease_qlen’ [-Werror=implicit-function-declaration]
  qdisc_tree_reduce_backlog(sch, 1, len);
  ^
/usr/src/sch_cake.orig/sch_cake.c: In function ‘cake_enqueue’:
/usr/src/sch_cake.orig/sch_cake.c:1429:5: error: implicit declaration of function ‘codel_watchdog_schedule_ns’ [-Werror=implicit-function-declaration]
     codel_watchdog_schedule_ns(&q->watchdog, next, true);
     ^
/usr/src/sch_cake.orig/sch_cake.c: In function ‘cake_dump_stats’:
/usr/src/sch_cake.orig/sch_cake.c:2573:3: error: implicit declaration of function ‘nla_put_u64_64bit’ [-Werror=implicit-function-declaration]
   PUT_TSTAT_U64(SENT_BYTES64, b->bytes);
   ^
cc1: some warnings being treated as errors
/usr/src/linux-headers-3.16.0-5-common/scripts/Makefile.build:268: recipe for target '/usr/src/sch_cake.orig/sch_cake.o' failed
make[4]: *** [/usr/src/sch_cake.orig/sch_cake.o] Error 1
/usr/src/linux-headers-3.16.0-5-common/Makefile:1355: recipe for target '_module_/usr/src/sch_cake.orig' failed
make[3]: *** [_module_/usr/src/sch_cake.orig] Error 2
Makefile:181: recipe for target 'sub-make' failed
make[2]: *** [sub-make] Error 2
Makefile:8: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-3.16.0-5-586'
Makefile:8: recipe for target 'default' failed
make: *** [default] Error 2

Hope that helps

Cake: High traffic leads to a system lock up and subsequent reboot

Tested with current cake on LEDE. Mvebu platform will hang when there are clients pulling in a lot of bandwidth. I do not have logs to prove this but build that do not include kmod-sched-core, kmod-sched, and kmod-sched-cake do not suffer from this issue. And the reboots seem to be present only when sqm selects a cake script with the cake kernel mod. This is the current version of cake on lede https://github.com/lede-project/source/blob/2e101b5e665204575d9546ac5737fc8d36b715d9/package/kernel/kmod-sched-cake/Makefile

cake doesn't compile on kernel 4.12

I can't copy and paste the error but it says the error is from sch_cake.c in function cake_change
line 1743 error is too few arguments for function nla_parse_nested

is the nat option needed on ingress or only egress, with nat?

What I'd wanted to do was apply the new tunneled skb->hash patch for tunnels in mainline,
but we cannot rely on it being set before nat kicked in. Which is a shame.

    if (flow_mode & CAKE_FLOW_FLOWS) {
            flow_hash = jhash_3words(
                    (__force u32)keys.dst,
                    (__force u32)keys.src ^ keys.ip_proto,
                    (__force u32)keys.ports, q->perturbation);
    }

Silently not working, Ubuntu 14.04.3 3.19.0-39-generic

After building, installing, and loading as per the instructions, I am unable to confirm that the cake scheduler is operational. Thank you for the release. Please advise:

root@gateway:~/sch_cake# make; make install
make -C /lib/modules/3.19.0-39-generic/build SUBDIRS=/root/sch_cake modules LDFLAGS_MODULE="--build-id=0xe0188bc53b814f96990980612a81ba7e221a42ff" CFLAGS_MODULE="-DCAKE_VERSION=\\\"e0188bc53b814f96990980612a81ba7e221a42ff\\\""
make[1]: Entering directory `/usr/src/linux-headers-3.19.0-39-generic'
  Building modules, stage 2.
  MODPOST 1 modules
make[1]: Leaving directory `/usr/src/linux-headers-3.19.0-39-generic'
install -v -m 644 sch_cake.ko /lib/modules/3.19.0-39-generic/kernel/net/sched/
removed ‘/lib/modules/3.19.0-39-generic/kernel/net/sched/sch_cake.ko’
‘sch_cake.ko’ -> ‘/lib/modules/3.19.0-39-generic/kernel/net/sched/sch_cake.ko’
depmod
modprobe sch_cake
root@gateway:~/sch_cake# tc qdisc del dev p4p1.4 root
root@gateway:~/sch_cake# tc qdisc add dev p4p1.4 root cake bandwidth 10mbit
Unknown qdisc "cake", hence option "bandwidth" is unparsable

Unsigned comparison with < 0

(now - flow->cvars.drop_next) < 0) {

Using a recent compiler, this line emits a warning about unsigned comparison with < 0.

Using the equivalent expression "(now < flow->cvars.drop_next)" avoids the issue

Overhead on ppp corrected -14 as if eth.

Hi been testing cake master on a ppp interface with a view to working out ptm overheads on UK VDSL2.

The working out overheads failed as it turned out that the modem does its own backed off QOS using rate tables with >>2 and strangely sometimes >>3 banding on packet size.

I did notice that using the overhead parameter needs +14 adding as it seems that cake treats ppp like eth and assumes that packet length is seen as +14, but on ppp tc sees ip length.

Ingress flag/mode/qdisc

As shortly discussed on the bloat mailing list [1] it would be awesome to have cake try to "shape" ingress bandwidth.

This could happen through a simple additional ingress parameter.

What would be even more awesome however was if the qdisc itself could simply be added as an ingress qdisc.
Right now, on a typical home router, you either have to redirect ingress traffic to an ifb device to shape the egress on that virtual device, or you shape the egress on the LAN device (where you need something like a prio qdisc to separate Internet from local traffic).
An ingress qdisc could directly be attached to the WAN interface, just like the egress qdisc.

[1] https://lists.bufferbloat.net/pipermail/bloat/2017-March/007896.html

Difficulty compiling on Ubuntu 18.04 Server

Using master branch ddf4c95. Fresh install of Ubuntu 18.04 server with kernel headers installed, with build-essentials installed.

First Error: Kernel does not support PIC mode.

make

make -C /lib/modules/4.15.0-38-generic/build SUBDIRS=/tmp/sch_cake modules LDFLAGS_MODULE="--build-id=0xddf4c95145f2fbcca16f19e01f3195d213ca760b" CFLAGS_MODULE="-DCAKE_VERSION=\\\"ddf4c95145f2fbcca16f19e01f3195d213ca760b\\\""
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-38-generic'
  CC [M]  /tmp/sch_cake/sch_cake.o
cc1: error: code model kernel does not support PIC mode
scripts/Makefile.build:339: recipe for target '/tmp/sch_cake/sch_cake.o' failed
make[2]: *** [/tmp/sch_cake/sch_cake.o] Error 1
Makefile:1551: recipe for target '_module_/tmp/sch_cake' failed
make[1]: *** [_module_/tmp/sch_cake] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-38-generic'
Makefile:8: recipe for target 'default' failed
make: *** [default] Error 2

First Error Workaround

Added EXTRA_CFLAGS += $(CFLAGS_EXTRA) -fno-pie to the makefile under the VERSION line.

Second Error

make

make -C /lib/modules/4.15.0-38-generic/build SUBDIRS=/tmp/sch_cake modules LDFLAGS_MODULE="--build-id=0xddf4c95145f2fbcca16f19e01f3195d213ca760b" CFLAGS_MODULE="-DCAKE_VERSION=\\\"ddf4c95145f2fbcca16f19e01f3195d213ca760b\\\""
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-38-generic'
  CC [M]  /tmp/sch_cake/sch_cake.o
In file included from ./include/linux/list.h:5:0,
                 from ./include/linux/module.h:9,
                 from /tmp/sch_cake/sch_cake.c:53:
./include/linux/types.h:17:9: error: unknown type name ‘__kernel_ino_t’
 typedef __kernel_ino_t  ino_t;
         ^~~~~~~~~~~~~~
./include/linux/types.h:18:9: error: unknown type name ‘__kernel_mode_t’
 typedef __kernel_mode_t  mode_t;
         ^~~~~~~~~~~~~~~
./include/linux/types.h:21:9: error: unknown type name ‘__kernel_off_t’
 typedef __kernel_off_t  off_t;
         ^~~~~~~~~~~~~~
./include/linux/types.h:22:9: error: unknown type name ‘__kernel_pid_t’
 typedef __kernel_pid_t  pid_t;
         ^~~~~~~~~~~~~~
./include/linux/types.h:23:9: error: unknown type name ‘__kernel_daddr_t’
 typedef __kernel_daddr_t daddr_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:25:9: error: unknown type name ‘__kernel_suseconds_t’
 typedef __kernel_suseconds_t suseconds_t;
         ^~~~~~~~~~~~~~~~~~~~
./include/linux/types.h:26:9: error: unknown type name ‘__kernel_timer_t’
 typedef __kernel_timer_t timer_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:27:9: error: unknown type name ‘__kernel_clockid_t’
 typedef __kernel_clockid_t clockid_t;
         ^~~~~~~~~~~~~~~~~~
./include/linux/types.h:32:9: error: unknown type name ‘__kernel_uid32_t’
 typedef __kernel_uid32_t uid_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:33:9: error: unknown type name ‘__kernel_gid32_t’
 typedef __kernel_gid32_t gid_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:34:9: error: unknown type name ‘__kernel_uid16_t’
 typedef __kernel_uid16_t        uid16_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:35:9: error: unknown type name ‘__kernel_gid16_t’
 typedef __kernel_gid16_t        gid16_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:41:9: error: unknown type name ‘__kernel_old_uid_t’
 typedef __kernel_old_uid_t old_uid_t;
         ^~~~~~~~~~~~~~~~~~
./include/linux/types.h:42:9: error: unknown type name ‘__kernel_old_gid_t’
 typedef __kernel_old_gid_t old_gid_t;
         ^~~~~~~~~~~~~~~~~~
./include/linux/types.h:46:9: error: unknown type name ‘__kernel_loff_t’
 typedef __kernel_loff_t  loff_t;
         ^~~~~~~~~~~~~~~
./include/linux/types.h:55:9: error: unknown type name ‘__kernel_size_t’
 typedef __kernel_size_t  size_t;
         ^~~~~~~~~~~~~~~
./include/linux/types.h:60:9: error: unknown type name ‘__kernel_ssize_t’
 typedef __kernel_ssize_t ssize_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:65:9: error: unknown type name ‘__kernel_ptrdiff_t’
 typedef __kernel_ptrdiff_t ptrdiff_t;
         ^~~~~~~~~~~~~~~~~~
./include/linux/types.h:70:9: error: unknown type name ‘__kernel_time_t’
 typedef __kernel_time_t  time_t;
         ^~~~~~~~~~~~~~~
./include/linux/types.h:75:9: error: unknown type name ‘__kernel_clock_t’
 typedef __kernel_clock_t clock_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:80:9: error: unknown type name ‘__kernel_caddr_t’
 typedef __kernel_caddr_t caddr_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:199:2: error: unknown type name ‘__kernel_daddr_t’
  __kernel_daddr_t f_tfree;
  ^~~~~~~~~~~~~~~~
./include/linux/types.h:200:2: error: unknown type name ‘__kernel_ino_t’
  __kernel_ino_t  f_tinode;
  ^~~~~~~~~~~~~~
In file included from ./include/linux/list.h:9:0,
                 from ./include/linux/module.h:9,
                 from /tmp/sch_cake/sch_cake.c:53:
./include/linux/kernel.h:6:10: fatal error: stdarg.h: No such file or directory
 #include <stdarg.h>
          ^~~~~~~~~~
compilation terminated.
scripts/Makefile.build:339: recipe for target '/tmp/sch_cake/sch_cake.o' failed
make[2]: *** [/tmp/sch_cake/sch_cake.o] Error 1
Makefile:1551: recipe for target '_module_/tmp/sch_cake' failed
make[1]: *** [_module_/tmp/sch_cake] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-38-generic'
Makefile:10: recipe for target 'default' failed
make: *** [default] Error 2

Second Error Workaround

Changed my custom EXTRA_CFLAGS line to read

EXTRA_CFLAGS += $(CFLAGS_EXTRA) -fno-pie -I/usr/lib/gcc/x86_64-linux-gnu/7/include/

Third error

make

make -C /lib/modules/4.15.0-38-generic/build SUBDIRS=/tmp/sch_cake modules LDFLAGS_MODULE="--build-id=0xddf4c95145f2fbcca16f19e01f3195d213ca760b" CFLAGS_MODULE="-DCAKE_VERSION=\\\"ddf4c95145f2fbcca16f19e01f3195d213ca760b\\\""
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-38-generic'
  CC [M]  /tmp/sch_cake/sch_cake.o
In file included from ./include/linux/list.h:5:0,
                 from ./include/linux/module.h:9,
                 from /tmp/sch_cake/sch_cake.c:53:
./include/linux/types.h:17:9: error: unknown type name ‘__kernel_ino_t’
 typedef __kernel_ino_t  ino_t;
         ^~~~~~~~~~~~~~
./include/linux/types.h:18:9: error: unknown type name ‘__kernel_mode_t’
 typedef __kernel_mode_t  mode_t;
         ^~~~~~~~~~~~~~~
./include/linux/types.h:21:9: error: unknown type name ‘__kernel_off_t’
 typedef __kernel_off_t  off_t;
         ^~~~~~~~~~~~~~
./include/linux/types.h:22:9: error: unknown type name ‘__kernel_pid_t’
 typedef __kernel_pid_t  pid_t;
         ^~~~~~~~~~~~~~
./include/linux/types.h:23:9: error: unknown type name ‘__kernel_daddr_t’
 typedef __kernel_daddr_t daddr_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:25:9: error: unknown type name ‘__kernel_suseconds_t’
 typedef __kernel_suseconds_t suseconds_t;
         ^~~~~~~~~~~~~~~~~~~~
./include/linux/types.h:26:9: error: unknown type name ‘__kernel_timer_t’
 typedef __kernel_timer_t timer_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:27:9: error: unknown type name ‘__kernel_clockid_t’
 typedef __kernel_clockid_t clockid_t;
         ^~~~~~~~~~~~~~~~~~
./include/linux/types.h:32:9: error: unknown type name ‘__kernel_uid32_t’
 typedef __kernel_uid32_t uid_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:33:9: error: unknown type name ‘__kernel_gid32_t’
 typedef __kernel_gid32_t gid_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:34:9: error: unknown type name ‘__kernel_uid16_t’
 typedef __kernel_uid16_t        uid16_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:35:9: error: unknown type name ‘__kernel_gid16_t’
 typedef __kernel_gid16_t        gid16_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:41:9: error: unknown type name ‘__kernel_old_uid_t’
 typedef __kernel_old_uid_t old_uid_t;
         ^~~~~~~~~~~~~~~~~~
./include/linux/types.h:42:9: error: unknown type name ‘__kernel_old_gid_t’
 typedef __kernel_old_gid_t old_gid_t;
         ^~~~~~~~~~~~~~~~~~
./include/linux/types.h:46:9: error: unknown type name ‘__kernel_loff_t’
 typedef __kernel_loff_t  loff_t;
         ^~~~~~~~~~~~~~~
./include/linux/types.h:55:9: error: unknown type name ‘__kernel_size_t’
 typedef __kernel_size_t  size_t;
         ^~~~~~~~~~~~~~~
./include/linux/types.h:60:9: error: unknown type name ‘__kernel_ssize_t’
 typedef __kernel_ssize_t ssize_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:65:9: error: unknown type name ‘__kernel_ptrdiff_t’
 typedef __kernel_ptrdiff_t ptrdiff_t;
         ^~~~~~~~~~~~~~~~~~
./include/linux/types.h:70:9: error: unknown type name ‘__kernel_time_t’
 typedef __kernel_time_t  time_t;
         ^~~~~~~~~~~~~~~
./include/linux/types.h:75:9: error: unknown type name ‘__kernel_clock_t’
 typedef __kernel_clock_t clock_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:80:9: error: unknown type name ‘__kernel_caddr_t’
 typedef __kernel_caddr_t caddr_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:199:2: error: unknown type name ‘__kernel_daddr_t’
  __kernel_daddr_t f_tfree;
  ^~~~~~~~~~~~~~~~
./include/linux/types.h:200:2: error: unknown type name ‘__kernel_ino_t’
  __kernel_ino_t  f_tinode;
  ^~~~~~~~~~~~~~
In file included from ./include/linux/kernel.h:7:0,
                 from ./include/linux/list.h:9,
                 from ./include/linux/module.h:9,
                 from /tmp/sch_cake/sch_cake.c:53:
./include/linux/linkage.h:8:10: fatal error: asm/linkage.h: No such file or directory
 #include <asm/linkage.h>
          ^~~~~~~~~~~~~~~
compilation terminated.
scripts/Makefile.build:339: recipe for target '/tmp/sch_cake/sch_cake.o' failed
make[2]: *** [/tmp/sch_cake/sch_cake.o] Error 1
Makefile:1551: recipe for target '_module_/tmp/sch_cake' failed
make[1]: *** [_module_/tmp/sch_cake] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-38-generic'
Makefile:10: recipe for target 'default' failed
make: *** [default] Error 2

Third error workaround

ln -s /usr/src/linux-headers-4.15.0-38-generic/include/asm-generic /usr/src/linux-headers-4.15.0-38-generic/include/asm

I don't really know what I'm doing here, I think there is a more fundamental problem that I'm missing, and it may be related to how ubuntu handles kernel headers.

Anyway. Let's continue.

Fourth Error

make -C /lib/modules/4.15.0-38-generic/build SUBDIRS=/tmp/sch_cake modules LDFLAGS_MODULE="--build-id=0xddf4c95145f2fbcca16f19e01f3195d213ca760b" CFLAGS_MODULE="-DCAKE_VERSION=\\\"ddf4c95145f2fbcca16f19e01f3195d213ca760b\\\""
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-38-generic'
  CC [M]  /tmp/sch_cake/sch_cake.o
In file included from ./include/linux/list.h:5:0,
                 from ./include/linux/module.h:9,
                 from /tmp/sch_cake/sch_cake.c:53:
./include/linux/types.h:17:9: error: unknown type name ‘__kernel_ino_t’
 typedef __kernel_ino_t  ino_t;
         ^~~~~~~~~~~~~~
./include/linux/types.h:18:9: error: unknown type name ‘__kernel_mode_t’
 typedef __kernel_mode_t  mode_t;
         ^~~~~~~~~~~~~~~
./include/linux/types.h:21:9: error: unknown type name ‘__kernel_off_t’
 typedef __kernel_off_t  off_t;
         ^~~~~~~~~~~~~~
./include/linux/types.h:22:9: error: unknown type name ‘__kernel_pid_t’
 typedef __kernel_pid_t  pid_t;
         ^~~~~~~~~~~~~~
./include/linux/types.h:23:9: error: unknown type name ‘__kernel_daddr_t’
 typedef __kernel_daddr_t daddr_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:25:9: error: unknown type name ‘__kernel_suseconds_t’
 typedef __kernel_suseconds_t suseconds_t;
         ^~~~~~~~~~~~~~~~~~~~
./include/linux/types.h:26:9: error: unknown type name ‘__kernel_timer_t’
 typedef __kernel_timer_t timer_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:27:9: error: unknown type name ‘__kernel_clockid_t’
 typedef __kernel_clockid_t clockid_t;
         ^~~~~~~~~~~~~~~~~~
./include/linux/types.h:32:9: error: unknown type name ‘__kernel_uid32_t’
 typedef __kernel_uid32_t uid_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:33:9: error: unknown type name ‘__kernel_gid32_t’
 typedef __kernel_gid32_t gid_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:34:9: error: unknown type name ‘__kernel_uid16_t’
 typedef __kernel_uid16_t        uid16_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:35:9: error: unknown type name ‘__kernel_gid16_t’
 typedef __kernel_gid16_t        gid16_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:41:9: error: unknown type name ‘__kernel_old_uid_t’
 typedef __kernel_old_uid_t old_uid_t;
         ^~~~~~~~~~~~~~~~~~
./include/linux/types.h:42:9: error: unknown type name ‘__kernel_old_gid_t’
 typedef __kernel_old_gid_t old_gid_t;
         ^~~~~~~~~~~~~~~~~~
./include/linux/types.h:46:9: error: unknown type name ‘__kernel_loff_t’
 typedef __kernel_loff_t  loff_t;
         ^~~~~~~~~~~~~~~
./include/linux/types.h:55:9: error: unknown type name ‘__kernel_size_t’
 typedef __kernel_size_t  size_t;
         ^~~~~~~~~~~~~~~
./include/linux/types.h:60:9: error: unknown type name ‘__kernel_ssize_t’
 typedef __kernel_ssize_t ssize_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:65:9: error: unknown type name ‘__kernel_ptrdiff_t’
 typedef __kernel_ptrdiff_t ptrdiff_t;
         ^~~~~~~~~~~~~~~~~~
./include/linux/types.h:70:9: error: unknown type name ‘__kernel_time_t’
 typedef __kernel_time_t  time_t;
         ^~~~~~~~~~~~~~~
./include/linux/types.h:75:9: error: unknown type name ‘__kernel_clock_t’
 typedef __kernel_clock_t clock_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:80:9: error: unknown type name ‘__kernel_caddr_t’
 typedef __kernel_caddr_t caddr_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:199:2: error: unknown type name ‘__kernel_daddr_t’
  __kernel_daddr_t f_tfree;
  ^~~~~~~~~~~~~~~~
./include/linux/types.h:200:2: error: unknown type name ‘__kernel_ino_t’
  __kernel_ino_t  f_tinode;
  ^~~~~~~~~~~~~~
In file included from ./include/asm-generic/bitops/atomic.h:9:0,
                 from ./include/asm/bitops.h:33,
                 from ./include/linux/bitops.h:38,
                 from ./include/linux/kernel.h:11,
                 from ./include/linux/list.h:9,
                 from ./include/linux/module.h:9,
                 from /tmp/sch_cake/sch_cake.c:53:
./include/asm/spinlock.h:9:2: error: #error need an architecture specific asm/spinlock.h
 #error need an architecture specific asm/spinlock.h
  ^~~~~
In file included from ./include/asm/bitops.h:33:0,
                 from ./include/linux/bitops.h:38,
                 from ./include/linux/kernel.h:11,
                 from ./include/linux/list.h:9,
                 from ./include/linux/module.h:9,
                 from /tmp/sch_cake/sch_cake.c:53:
./include/asm-generic/bitops/atomic.h:19:8: error: unknown type name ‘arch_spinlock_t’
 extern arch_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned;
        ^~~~~~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:19:56: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__lock_aligned’
 extern arch_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned;
                                                        ^~~~~~~~~~~~~~
./include/asm-generic/bitops/atomic.h: In function ‘set_bit’:
./include/asm-generic/bitops/atomic.h:24:2: error: unknown type name ‘arch_spinlock_t’
  arch_spinlock_t *s = ATOMIC_HASH(l); \
  ^
./include/asm-generic/bitops/atomic.h:72:2: note: in expansion of macro ‘_atomic_spin_lock_irqsave’
  _atomic_spin_lock_irqsave(p, flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:17:29: error: ‘__atomic_hash’ undeclared (first use in this function); did you mean ‘__atomic_load’?
 #  define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) a)/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
                             ^
./include/asm-generic/bitops/atomic.h:24:23: note: in expansion of macro ‘ATOMIC_HASH’
  arch_spinlock_t *s = ATOMIC_HASH(l); \
                       ^~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:72:2: note: in expansion of macro ‘_atomic_spin_lock_irqsave’
  _atomic_spin_lock_irqsave(p, flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:17:29: note: each undeclared identifier is reported only once for each function it appears in
 #  define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) a)/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
                             ^
./include/asm-generic/bitops/atomic.h:24:23: note: in expansion of macro ‘ATOMIC_HASH’
  arch_spinlock_t *s = ATOMIC_HASH(l); \
                       ^~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:72:2: note: in expansion of macro ‘_atomic_spin_lock_irqsave’
  _atomic_spin_lock_irqsave(p, flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:26:2: error: implicit declaration of function ‘arch_spin_lock’ [-Werror=implicit-function-declaration]
  arch_spin_lock(s);   \
  ^
./include/asm-generic/bitops/atomic.h:72:2: note: in expansion of macro ‘_atomic_spin_lock_irqsave’
  _atomic_spin_lock_irqsave(p, flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:30:2: error: unknown type name ‘arch_spinlock_t’
  arch_spinlock_t *s = ATOMIC_HASH(l);  \
  ^
./include/asm-generic/bitops/atomic.h:74:2: note: in expansion of macro ‘_atomic_spin_unlock_irqrestore’
  _atomic_spin_unlock_irqrestore(p, flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:31:2: error: implicit declaration of function ‘arch_spin_unlock’; did you mean ‘clear_bit_unlock’? [-Werror=implicit-function-declaration]
  arch_spin_unlock(s);    \
  ^
./include/asm-generic/bitops/atomic.h:74:2: note: in expansion of macro ‘_atomic_spin_unlock_irqrestore’
  _atomic_spin_unlock_irqrestore(p, flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bitops/atomic.h: In function ‘clear_bit’:
./include/asm-generic/bitops/atomic.h:24:2: error: unknown type name ‘arch_spinlock_t’
  arch_spinlock_t *s = ATOMIC_HASH(l); \
  ^
./include/asm-generic/bitops/atomic.h:93:2: note: in expansion of macro ‘_atomic_spin_lock_irqsave’
  _atomic_spin_lock_irqsave(p, flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:17:29: error: ‘__atomic_hash’ undeclared (first use in this function); did you mean ‘__atomic_load’?
 #  define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) a)/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
                             ^
./include/asm-generic/bitops/atomic.h:24:23: note: in expansion of macro ‘ATOMIC_HASH’
  arch_spinlock_t *s = ATOMIC_HASH(l); \
                       ^~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:93:2: note: in expansion of macro ‘_atomic_spin_lock_irqsave’
  _atomic_spin_lock_irqsave(p, flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:30:2: error: unknown type name ‘arch_spinlock_t’
  arch_spinlock_t *s = ATOMIC_HASH(l);  \
  ^
./include/asm-generic/bitops/atomic.h:95:2: note: in expansion of macro ‘_atomic_spin_unlock_irqrestore’
  _atomic_spin_unlock_irqrestore(p, flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bitops/atomic.h: In function ‘change_bit’:
./include/asm-generic/bitops/atomic.h:24:2: error: unknown type name ‘arch_spinlock_t’
  arch_spinlock_t *s = ATOMIC_HASH(l); \
  ^
./include/asm-generic/bitops/atomic.h:114:2: note: in expansion of macro ‘_atomic_spin_lock_irqsave’
  _atomic_spin_lock_irqsave(p, flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:17:29: error: ‘__atomic_hash’ undeclared (first use in this function); did you mean ‘__atomic_load’?
 #  define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) a)/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
                             ^
./include/asm-generic/bitops/atomic.h:24:23: note: in expansion of macro ‘ATOMIC_HASH’
  arch_spinlock_t *s = ATOMIC_HASH(l); \
                       ^~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:114:2: note: in expansion of macro ‘_atomic_spin_lock_irqsave’
  _atomic_spin_lock_irqsave(p, flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:30:2: error: unknown type name ‘arch_spinlock_t’
  arch_spinlock_t *s = ATOMIC_HASH(l);  \
  ^
./include/asm-generic/bitops/atomic.h:116:2: note: in expansion of macro ‘_atomic_spin_unlock_irqrestore’
  _atomic_spin_unlock_irqrestore(p, flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bitops/atomic.h: In function ‘test_and_set_bit’:
./include/asm-generic/bitops/atomic.h:24:2: error: unknown type name ‘arch_spinlock_t’
  arch_spinlock_t *s = ATOMIC_HASH(l); \
  ^
./include/asm-generic/bitops/atomic.h:135:2: note: in expansion of macro ‘_atomic_spin_lock_irqsave’
  _atomic_spin_lock_irqsave(p, flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:17:29: error: ‘__atomic_hash’ undeclared (first use in this function); did you mean ‘__atomic_load’?
 #  define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) a)/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
                             ^
./include/asm-generic/bitops/atomic.h:24:23: note: in expansion of macro ‘ATOMIC_HASH’
  arch_spinlock_t *s = ATOMIC_HASH(l); \
                       ^~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:135:2: note: in expansion of macro ‘_atomic_spin_lock_irqsave’
  _atomic_spin_lock_irqsave(p, flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:30:2: error: unknown type name ‘arch_spinlock_t’
  arch_spinlock_t *s = ATOMIC_HASH(l);  \
  ^
./include/asm-generic/bitops/atomic.h:138:2: note: in expansion of macro ‘_atomic_spin_unlock_irqrestore’
  _atomic_spin_unlock_irqrestore(p, flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bitops/atomic.h: In function ‘test_and_clear_bit’:
./include/asm-generic/bitops/atomic.h:24:2: error: unknown type name ‘arch_spinlock_t’
  arch_spinlock_t *s = ATOMIC_HASH(l); \
  ^
./include/asm-generic/bitops/atomic.h:159:2: note: in expansion of macro ‘_atomic_spin_lock_irqsave’
  _atomic_spin_lock_irqsave(p, flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:17:29: error: ‘__atomic_hash’ undeclared (first use in this function); did you mean ‘__atomic_load’?
 #  define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) a)/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
                             ^
./include/asm-generic/bitops/atomic.h:24:23: note: in expansion of macro ‘ATOMIC_HASH’
  arch_spinlock_t *s = ATOMIC_HASH(l); \
                       ^~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:159:2: note: in expansion of macro ‘_atomic_spin_lock_irqsave’
  _atomic_spin_lock_irqsave(p, flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:30:2: error: unknown type name ‘arch_spinlock_t’
  arch_spinlock_t *s = ATOMIC_HASH(l);  \
  ^
./include/asm-generic/bitops/atomic.h:162:2: note: in expansion of macro ‘_atomic_spin_unlock_irqrestore’
  _atomic_spin_unlock_irqrestore(p, flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bitops/atomic.h: In function ‘test_and_change_bit’:
./include/asm-generic/bitops/atomic.h:24:2: error: unknown type name ‘arch_spinlock_t’
  arch_spinlock_t *s = ATOMIC_HASH(l); \
  ^
./include/asm-generic/bitops/atomic.h:182:2: note: in expansion of macro ‘_atomic_spin_lock_irqsave’
  _atomic_spin_lock_irqsave(p, flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:17:29: error: ‘__atomic_hash’ undeclared (first use in this function); did you mean ‘__atomic_load’?
 #  define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) a)/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
                             ^
./include/asm-generic/bitops/atomic.h:24:23: note: in expansion of macro ‘ATOMIC_HASH’
  arch_spinlock_t *s = ATOMIC_HASH(l); \
                       ^~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:182:2: note: in expansion of macro ‘_atomic_spin_lock_irqsave’
  _atomic_spin_lock_irqsave(p, flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bitops/atomic.h:30:2: error: unknown type name ‘arch_spinlock_t’
  arch_spinlock_t *s = ATOMIC_HASH(l);  \
  ^
./include/asm-generic/bitops/atomic.h:185:2: note: in expansion of macro ‘_atomic_spin_unlock_irqrestore’
  _atomic_spin_unlock_irqrestore(p, flags);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./include/uapi/linux/kernel.h:5:0,
                 from ./include/linux/cache.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/linux/kernel.h:14,
                 from ./include/linux/list.h:9,
                 from ./include/linux/module.h:9,
                 from /tmp/sch_cake/sch_cake.c:53:
./include/uapi/linux/sysinfo.h: At top level:
./include/uapi/linux/sysinfo.h:9:2: error: unknown type name ‘__kernel_long_t’
  __kernel_long_t uptime;  /* Seconds since boot */
  ^~~~~~~~~~~~~~~
./include/uapi/linux/sysinfo.h:10:2: error: unknown type name ‘__kernel_ulong_t’
  __kernel_ulong_t loads[3]; /* 1, 5, and 15 minute load averages */
  ^~~~~~~~~~~~~~~~
./include/uapi/linux/sysinfo.h:11:2: error: unknown type name ‘__kernel_ulong_t’
  __kernel_ulong_t totalram; /* Total usable main memory size */
  ^~~~~~~~~~~~~~~~
./include/uapi/linux/sysinfo.h:12:2: error: unknown type name ‘__kernel_ulong_t’
  __kernel_ulong_t freeram; /* Available memory size */
  ^~~~~~~~~~~~~~~~
./include/uapi/linux/sysinfo.h:13:2: error: unknown type name ‘__kernel_ulong_t’
  __kernel_ulong_t sharedram; /* Amount of shared memory */
  ^~~~~~~~~~~~~~~~
./include/uapi/linux/sysinfo.h:14:2: error: unknown type name ‘__kernel_ulong_t’
  __kernel_ulong_t bufferram; /* Memory used by buffers */
  ^~~~~~~~~~~~~~~~
./include/uapi/linux/sysinfo.h:15:2: error: unknown type name ‘__kernel_ulong_t’
  __kernel_ulong_t totalswap; /* Total swap space size */
  ^~~~~~~~~~~~~~~~
./include/uapi/linux/sysinfo.h:16:2: error: unknown type name ‘__kernel_ulong_t’
  __kernel_ulong_t freeswap; /* swap space still available */
  ^~~~~~~~~~~~~~~~
./include/uapi/linux/sysinfo.h:19:2: error: unknown type name ‘__kernel_ulong_t’
  __kernel_ulong_t totalhigh; /* Total high memory size */
  ^~~~~~~~~~~~~~~~
./include/uapi/linux/sysinfo.h:20:2: error: unknown type name ‘__kernel_ulong_t’
  __kernel_ulong_t freehigh; /* Available high memory size */
  ^~~~~~~~~~~~~~~~
./include/uapi/linux/sysinfo.h:22:22: error: ‘__kernel_ulong_t’ undeclared here (not in a function); did you mean ‘__kernel_dev_t’?
  char _f[20-2*sizeof(__kernel_ulong_t)-sizeof(__u32)]; /* Padding: libc5 uses this.. */
                      ^~~~~~~~~~~~~~~~
                      __kernel_dev_t
In file included from ./include/linux/list.h:9:0,
                 from ./include/linux/module.h:9,
                 from /tmp/sch_cake/sch_cake.c:53:
./include/linux/kernel.h:466:5: warning: conflicting types for built-in function ‘snprintf’ [-Wbuiltin-declaration-mismatch]
 int snprintf(char *buf, size_t size, const char *fmt, ...);
     ^~~~~~~~
./include/linux/kernel.h:468:5: warning: conflicting types for built-in function ‘vsnprintf’ [-Wbuiltin-declaration-mismatc ]
 int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
     ^~~~~~~~~
In file included from ./include/linux/stat.h:6:0,
                 from ./include/linux/module.h:10,
                 from /tmp/sch_cake/sch_cake.c:53:
./arch/x86/include/uapi/asm/stat.h:84:2: error: expected specifier-qualifier-list before ‘__kernel_ulong_t’
  __kernel_ulong_t st_dev;
  ^~~~~~~~~~~~~~~~
In file included from ./include/asm/preempt.h:5:0,
                 from ./include/linux/preempt.h:81,
                 from ./include/linux/spinlock.h:51,
                 from ./include/linux/seqlock.h:36,
                 from ./include/linux/time.h:6,
                 from ./include/linux/stat.h:19,
                 from ./include/linux/module.h:10,
                 from /tmp/sch_cake/sch_cake.c:53:
./include/linux/thread_info.h:38:10: fatal error: asm/thread_info.h: No such file or directory
 #include <asm/thread_info.h>
          ^~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
compilation terminated.
scripts/Makefile.build:339: recipe for target '/tmp/sch_cake/sch_cake.o' failed
make[2]: *** [/tmp/sch_cake/sch_cake.o] Error 1
Makefile:1551: recipe for target '_module_/tmp/sch_cake' failed
make[1]: *** [_module_/tmp/sch_cake] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-38-generic'
Makefile:10: recipe for target 'default' failed
make: *** [default] Error 2

What next?

I could keep trying workarounds but I think something is wrong. This is a new ubuntu 18.04 server, so I thought the config would be pretty standard. Any ideas?

More random debugging info

dpkg -l "*headers*"

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                    Version                  Architecture             Description
+++-=======================================-========================-========================-====================================================================================
un  linux-headers                           <none>                   <none>                   (no description available)
un  linux-headers-3.0                       <none>                   <none>                   (no description available)
ii  linux-headers-4.15.0-29                 4.15.0-29.31             all                      Header files related to Linux kernel version 4.15.0
ii  linux-headers-4.15.0-29-generic         4.15.0-29.31             amd64                    Linux kernel headers for version 4.15.0 on 64 bit x86 SMP
ii  linux-headers-4.15.0-38                 4.15.0-38.41             all                      Header files related to Linux kernel version 4.15.0
ii  linux-headers-4.15.0-38-generic         4.15.0-38.41             amd64                    Linux kernel headers for version 4.15.0 on 64 bit x86 SMP
ii  linux-headers-generic                   4.15.0.38.40             amd64                    Generic Linux kernel headers
un  linux-kernel-headers                    <none>                   <none>                   (no description available)

uname -a

Linux myhost 4.15.0-38-generic #41-Ubuntu SMP Wed Oct 10 10:59:38 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

at line rate cake stats are very inaccurate

Probably due to the bypass and due to the peeling, cake stats can be really inaccurate at line rate. Going through the router you'd think the two numbers would be a bit close but...

d@dancer:~/git/cleanups$ netperf -H fd95::67
MIGRATED TCP STREAM TEST from ::0 (::) port 0 AF_INET6 to fd95::67 () port 0 AF_INET6 : demo
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec

87380 16384 16384 10.16 907.50

These two ethernet devices should essentially have at least a nearly equal number of bytes.

root@apu2:~# tc -s qdisc show dev enp3s0
qdisc mq 0: root 
 Sent 21520096 bytes 249944 pkt (dropped 0, overlimits 0 requeues 11) 
 backlog 0b 0p requeues 11 
qdisc cake 0: parent :4 unlimited diffserv3 triple-isolate rtt 100.0ms raw 
 Sent 16010 bytes 61 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0 
 memory used: 0b of 15140Kb
 capacity estimate: 0bit
                 Bulk   Best Effort      Voice
  thresh          0bit        0bit        0bit
  target         5.0ms       5.0ms       5.0ms
  interval     100.0ms     100.0ms      10.0ms
  pk_delay         0us         0us         0us
  av_delay         0us         0us         0us
  sp_delay         0us         0us         0us
  pkts               0           0           0
  bytes              0           0           0
  way_inds           0           0           0
  way_miss           0           0           0
  way_cols           0           0           0
  drops              0           0           0
  marks              0           0           0
  sp_flows           0           0           0
  bk_flows           0           0           0
  un_flows           0           0           0
  max_len            0           0           0

qdisc cake 0: parent :3 unlimited diffserv3 triple-isolate rtt 100.0ms raw 
 Sent 19388 bytes 84 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0 
 memory used: 0b of 15140Kb
 capacity estimate: 0bit
                 Bulk   Best Effort      Voice
  thresh          0bit        0bit        0bit
  target         5.0ms       5.0ms       5.0ms
  interval     100.0ms     100.0ms      10.0ms
  pk_delay         0us         0us         0us
  av_delay         0us         0us         0us
  sp_delay         0us         0us         0us
  pkts               0           0           0
  bytes              0           0           0
  way_inds           0           0           0
  way_miss           0           0           0
  way_cols           0           0           0
  drops              0           0           0
  marks              0           0           0
  sp_flows           0           0           0
  bk_flows           0           0           0
  un_flows           0           0           0
  max_len            0           0           0

qdisc cake 0: parent :2 unlimited diffserv3 triple-isolate rtt 100.0ms raw 
 Sent 2578 bytes 7 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0 
 memory used: 0b of 15140Kb
 capacity estimate: 0bit
                 Bulk   Best Effort      Voice
  thresh          0bit        0bit        0bit
  target         5.0ms       5.0ms       5.0ms
  interval     100.0ms     100.0ms      10.0ms
  pk_delay         0us         0us         0us
  av_delay         0us         0us         0us
  sp_delay         0us         0us         0us
  pkts               0           0           0
  bytes              0           0           0
  way_inds           0           0           0
  way_miss           0           0           0
  way_cols           0           0           0
  drops              0           0           0
  marks              0           0           0
  sp_flows           0           0           0
  bk_flows           0           0           0
  un_flows           0           0           0
  max_len            0           0           0

qdisc cake 0: parent :1 unlimited diffserv3 triple-isolate rtt 100.0ms raw 
 Sent 21482120 bytes 249792 pkt (dropped 0, overlimits 0 requeues 11) 
 backlog 0b 0p requeues 11 
 memory used: 3584b of 15140Kb
 capacity estimate: 0bit
                 Bulk   Best Effort      Voice
  thresh          0bit        0bit        0bit
  target         5.0ms       5.0ms       5.0ms
  interval     100.0ms     100.0ms      10.0ms
  pk_delay         0us        31us         0us
  av_delay         0us         1us         0us
  sp_delay         0us         1us         0us
  pkts               0          18           0
  bytes              0        1548           0
  way_inds           0           0           0
  way_miss           0           1           0
  way_cols           0           0           0
  drops              0           0           0
  marks              0           0           0
  sp_flows           0           1           0
  bk_flows           0           0           0
  un_flows           0           0           0
  max_len            0          86           0

But not even close.

root@apu2:~# 
root@apu2:~# tc -s qdisc show dev enp2s0
qdisc mq 0: root 
 Sent 1222489268 bytes 807546 pkt (dropped 0, overlimits 0 requeues 69) 
 backlog 0b 0p requeues 69 
qdisc cake 0: parent :4 unlimited diffserv3 triple-isolate rtt 100.0ms raw 
 Sent 2266 bytes 11 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0 
 memory used: 0b of 15140Kb
 capacity estimate: 0bit
                 Bulk   Best Effort      Voice
  thresh          0bit        0bit        0bit
  target         5.0ms       5.0ms       5.0ms
  interval     100.0ms     100.0ms      10.0ms
  pk_delay         0us         0us         0us
  av_delay         0us         0us         0us
  sp_delay         0us         0us         0us
  pkts               0           0           0
  bytes              0           0           0
  way_inds           0           0           0
  way_miss           0           0           0
  way_cols           0           0           0
  drops              0           0           0
  marks              0           0           0
  sp_flows           0           0           0
  bk_flows           0           0           0
  un_flows           0           0           0
  max_len            0           0           0

qdisc cake 0: parent :3 unlimited diffserv3 triple-isolate rtt 100.0ms raw 
 Sent 1222469742 bytes 807455 pkt (dropped 0, overlimits 0 requeues 69) 
 backlog 0b 0p requeues 69 
 memory used: 43920b of 15140Kb
 capacity estimate: 0bit
                 Bulk   Best Effort      Voice
  thresh          0bit        0bit        0bit
  target         5.0ms       5.0ms       5.0ms
  interval     100.0ms     100.0ms      10.0ms
  pk_delay         0us       236us         0us
  av_delay         0us        40us         0us
  sp_delay         0us        32us         0us
  pkts               0         128           0
  bytes              0      193792           0
  way_inds           0           0           0
  way_miss           0           1           0
  way_cols           0           0           0
  drops              0           0           0
  marks              0           0           0
  sp_flows           0           0           0
  bk_flows           0           1           0
  un_flows           0           0           0
  max_len            0       30280           0

qdisc cake 0: parent :2 unlimited diffserv3 triple-isolate rtt 100.0ms raw 
 Sent 17174 bytes 79 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0 
 memory used: 0b of 15140Kb
 capacity estimate: 0bit
                 Bulk   Best Effort      Voice
  thresh          0bit        0bit        0bit
  target         5.0ms       5.0ms       5.0ms
  interval     100.0ms     100.0ms      10.0ms
  pk_delay         0us         0us         0us
  av_delay         0us         0us         0us
  sp_delay         0us         0us         0us
  pkts               0           0           0
  bytes              0           0           0
  way_inds           0           0           0
  way_miss           0           0           0
  way_cols           0           0           0
  drops              0           0           0
  marks              0           0           0
  sp_flows           0           0           0
  bk_flows           0           0           0
  un_flows           0           0           0
  max_len            0           0           0

qdisc cake 0: parent :1 unlimited diffserv3 triple-isolate rtt 100.0ms raw 
 Sent 86 bytes 1 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0 
 memory used: 0b of 15140Kb
 capacity estimate: 0bit
                 Bulk   Best Effort      Voice
  thresh          0bit        0bit        0bit
  target         5.0ms       5.0ms       5.0ms
  interval     100.0ms     100.0ms      10.0ms
  pk_delay         0us         0us         0us
  av_delay         0us         0us         0us
  sp_delay         0us         0us         0us
  pkts               0           0           0
  bytes              0           0           0
  way_inds           0           0           0
  way_miss           0           0           0
  way_cols           0           0           0
  drops              0           0           0
  marks              0           0           0
  sp_flows           0           0           0
  bk_flows           0           0           0
  un_flows           0           0           0
  max_len            0           0           0

Make your internet not slow. or Make your internet latency be short.

This subject is correct cake qdisc benefit I think.
I recommand cake qdisc friends with saying [ this makes your internet faster ] ,
he says [ enough ] :P

I made advertising past days.
Some says [ make your internet fast ] , this is not lie but not benefit.
I think .

Anyway , Great jobs . thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.