Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] net/sched: sch_cake: per-packet cost of a shaping CAKE
@ 2026-11-29 15:11 Julius Bairaktaris
  2026-11-29 15:11 ` [PATCH net-next 1/4] net/sched: sch_cake: give the shaper timer slack Julius Bairaktaris
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Julius Bairaktaris @ 2026-11-29 15:11 UTC (permalink / raw)
  To: Toke Høiland-Jørgensen
  Cc: netdev, cake, Jamal Hadi Salim, Jiri Pirko, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Willem de Bruijn,
	Simon Horman, Victor Nogueira

These patches cut the work a shaping CAKE does per packet.

Patch 1 lets the shaper's watchdog fire up to four packet times late,
capped at 100 us, as sch_fq does with its timer_slack.

Patch 2 draws the dither of the flow quantum from a per-tin prandom
state instead of get_random_u16().

Patch 3 keeps a GSO aggregate whole in its flow queue while its wire
time is short against the AQM target, and splits it at dequeue when
COBALT may act on it. Patch 4 skips the flow dissection and the host
hashes for a packet whose flow already holds an active queue.

The series applies to net-next on its own. Jamal's "net/sched: cap the
accounted backlog before it can wrap" [1] rewrites the classification
and the split-GSO path of cake_enqueue() that patches 3 and 4 change, so
whichever lands second is rebased onto the other. The split that patch 3
adds at dequeue refuses only to wrap CAKE's own backlog here; with both
applied it needs the ancestor check that [1] adds to the split at
enqueue as well, which goes in with that rebase.

Tested under QEMU (KVM) on net-next: the cake and cake_mq tc-testing
cases pass with the series (46 of 46, 1 run). For patch 3, forwarded TCP
that veth GRO turns into frame lists goes through cake with split-gso at
900 Mbit/s and a 300 KB memory limit: the aggregates are queued whole,
the memory limit splits and drops segments, and the backlog returns to
zero when the traffic stops, with no warnings in 1 run.

Measured on a Xiaomi AX3600 router (IPQ8074, four Cortex-A53) with the
patches on OpenWrt's 6.18 kernel:

- Patch 1, CAKE at 900 Mbit/s on the host path with 8 TCP streams and
  four busy loops on the CPUs: 850/851/850 Mbit/s and an RTT p99 of
  7.1/8.3/21.0 ms, against 807/851/849 Mbit/s and 43.3/15.4/36.5 ms
  without the slack (3 runs each).
- Patch 2, shaping at 330/168 Mbit/s with 8 TCP streams: 6.4 % fewer
  cycles per packet on the download and 4.3 % on the upload (3 runs
  each; the noise between identical arms was about 3 %).
- Patch 3, a TCP download shaped at 320 Mbit/s: 10.5 % and 9.9 % fewer
  cycles per received packet than with every aggregate split (69505
  against 77660 and 62298 against 69153, one run each on two test
  images, so only the ratio counts), with the probe's p99.9 delay rise
  at 1.8 and 4.3 ms against 3.0 and 3.2 ms.
- Patch 4: in a perf profile of a shaped download before it, the
  dissection and the two host hashes took 736 of 11380 cycles per
  received packet (one profile).

I used Claude (Anthropic) to help write these patches.

[1] https://lore.kernel.org/all/QDISC-BA27.v13.r0.20261127065026@mojatatu.com/

Julius Bairaktaris (4):
  net/sched: sch_cake: give the shaper timer slack
  net/sched: sch_cake: dither the flow quantum from a per-tin generator
  net/sched: sch_cake: keep short GSO aggregates whole
  net/sched: sch_cake: skip the dissection for a packet of an active
    flow

 net/sched/sch_cake.c | 329 +++++++++++++++++++++++++++++++++++++++----
 1 file changed, 303 insertions(+), 26 deletions(-)


base-commit: f89726ffabef1b08c52e6163b7ab94b0d5f15503
-- 
2.53.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-11-30 15:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29 15:11 [PATCH net-next 0/4] net/sched: sch_cake: per-packet cost of a shaping CAKE Julius Bairaktaris
2026-11-29 15:11 ` [PATCH net-next 1/4] net/sched: sch_cake: give the shaper timer slack Julius Bairaktaris
2026-11-30 15:46   ` netdev-bot+sashiko
2026-11-29 15:11 ` [PATCH net-next 2/4] net/sched: sch_cake: dither the flow quantum from a per-tin generator Julius Bairaktaris
2026-11-30 15:46   ` netdev-bot+sashiko
2026-11-29 15:11 ` [PATCH net-next 3/4] net/sched: sch_cake: keep short GSO aggregates whole Julius Bairaktaris
2026-11-30 15:46   ` netdev-bot+sashiko
2026-11-29 15:11 ` [PATCH net-next 4/4] net/sched: sch_cake: skip the dissection for a packet of an active flow Julius Bairaktaris
2026-11-30 15:46   ` netdev-bot+sashiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox