Thread (10 messages) 10 messages, 4 authors, 2025-10-13

Re: [PATCH RFC net-next 4/4] net/sched: sch_cake: share shaper state across sub-instances of cake_mq

From: Donald Hunter <donald.hunter@gmail.com>
Date: 2025-09-25 09:06:04
Subsystem: networking [general], the rest, yaml netlink (ynl) · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds, Donald Hunter

Toke Høiland-Jørgensen [off-list ref] writes:
quoted hunk ↗ jump to hunk
From: Jonas Köppeler <redacted>

This commit adds shared shaper state across the cake instances beneath a
cake_mq qdisc. It works by periodically tracking the number of active
instances, and scaling the configured rate by the number of active
queues.

The scan is lockless and simply reads the qlen and the last_active state
variable of each of the instances configured beneath the parent cake_mq
instance. Locking is not required since the values are only updated by
the owning instance, and eventual consistency is sufficient for the
purpose of estimating the number of active queues.

The interval for scanning the number of active queues is configurable
and defaults to 200 us. We found this to be a good tradeoff between
overhead and response time. For a detailed analysis of this aspect see
the Netdevconf talk:

https://netdevconf.info/0x19/docs/netdev-0x19-paper16-talk-paper.pdf

Signed-off-by: Jonas Köppeler <redacted>
Signed-off-by: Toke Høiland-Jørgensen <redacted>
---
 include/uapi/linux/pkt_sched.h |  2 ++
 net/sched/sch_cake.c           | 67 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 69 insertions(+)
diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
index c2da76e78badebbdf7d5482cef1a3132aec99fe1..a4aa812bfbe86424c502de5bb2e5b1429b440088 100644
--- a/include/uapi/linux/pkt_sched.h
+++ b/include/uapi/linux/pkt_sched.h
@@ -1014,6 +1014,7 @@ enum {
 	TCA_CAKE_ACK_FILTER,
 	TCA_CAKE_SPLIT_GSO,
 	TCA_CAKE_FWMARK,
+	TCA_CAKE_SYNC_TIME,
 	__TCA_CAKE_MAX
 };
 #define TCA_CAKE_MAX	(__TCA_CAKE_MAX - 1)
@@ -1036,6 +1037,7 @@ enum {
 	TCA_CAKE_STATS_DROP_NEXT_US,
 	TCA_CAKE_STATS_P_DROP,
 	TCA_CAKE_STATS_BLUE_TIMER_US,
+	TCA_CAKE_STATS_ACTIVE_QUEUES,
 	__TCA_CAKE_STATS_MAX
 };
 #define TCA_CAKE_STATS_MAX (__TCA_CAKE_STATS_MAX - 1)
Hi Toke,

Could you include this diff in the patch to keep the ynl spec up to date?
diff --git a/Documentation/netlink/specs/tc.yaml b/Documentation/netlink/specs/tc.yaml
index b398f7a46dae..f0edc84f9613 100644
--- a/Documentation/netlink/specs/tc.yaml
+++ b/Documentation/netlink/specs/tc.yaml
@@ -2153,6 +2153,9 @@ attribute-sets:
       -
         name: fwmark
         type: u32
+      -
+        name: sync-time
+        type: u32
   -
     name: cake-stats-attrs
     name-prefix: tca-cake-stats-
@@ -2207,6 +2210,9 @@ attribute-sets:
       -
         name: blue-timer-us
         type: s32
+      -
+        name: active-queues
+        type: u32
   -
     name: cake-tin-stats-attrs
     name-prefix: tca-cake-tin-stats-
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help