[PATCH] net/sched: drr: reseed active class deficit after quantum changes
From: Samuel Moelius
Date: Mon Jun 08 2026 - 20:42:23 EST
Changing the quantum of an active DRR class leaves the old deficit in
place. The next scheduling round can therefore use credit accumulated
under a different quantum.
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 changed class weight is reflected immediately.
Assisted-by: Codex:gpt-5.5-cyber-preview
Signed-off-by: Samuel Moelius <sam.moelius@xxxxxxxxxxxxxxx>
---
net/sched/sch_drr.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c
index 01335a49e091..b40df8725ba6 100644
--- a/net/sched/sch_drr.c
+++ b/net/sched/sch_drr.c
@@ -98,8 +98,11 @@ static int drr_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
}
sch_tree_lock(sch);
- if (tb[TCA_DRR_QUANTUM])
+ if (tb[TCA_DRR_QUANTUM]) {
cl->quantum = quantum;
+ if (cl_is_active(cl))
+ cl->deficit = quantum;
+ }
sch_tree_unlock(sch);
return 0;
--
2.43.0