Thread (2 messages) 2 messages, 2 authors, 22d ago
COLD22d

[PATCH] net/sched: ets: reseed class deficit after quantum changes

From: Samuel Moelius <hidden>
Date: 2026-06-09 00:38:15
Also in: lkml
Subsystem: networking [general], tc subsystem, the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Jamal Hadi Salim, Jiri Pirko, Linus Torvalds

ETS class reconfiguration can change a class quantum while the class
remains active.  The scheduler keeps the old deficit and spends that
stale credit under the new configuration.

This can be observed by making a class active, changing its quantum, and
then dequeuing with the old deficit still present.

When an active class quantum changes, reseed its deficit from the new
quantum so the new class parameters take effect immediately.

Assisted-by: Codex:gpt-5.5-cyber-preview
Signed-off-by: Samuel Moelius <redacted>
---
 net/sched/sch_ets.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/net/sched/sch_ets.c b/net/sched/sch_ets.c
index a4b07b661b77..8e7c90689ed3 100644
--- a/net/sched/sch_ets.c
+++ b/net/sched/sch_ets.c
@@ -249,6 +249,8 @@ static int ets_class_change(struct Qdisc *sch, u32 classid, u32 parentid,
 
 	sch_tree_lock(sch);
 	cl->quantum = quantum;
+	if (cl_is_active(cl))
+		cl->deficit = quantum;
 	sch_tree_unlock(sch);
 
 	ets_offload_change(sch);
-- 
2.43.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help