Netdev List
 help / color / mirror / Atom feed
* [PATCH net] dql: Reset the adjusted limit when resetting the queue
@ 2026-10-20 23:03 Hungyu Lin
  2026-10-20 23:13 ` netdev-bot+sinfo
  0 siblings, 1 reply; 2+ messages in thread
From: Hungyu Lin @ 2026-10-20 23:03 UTC (permalink / raw)
  To: netdev
  Cc: davem, edumazet, kuba, pabeni, horms, akpm, linux-kernel, stable,
	Hungyu Lin

dql_reset() resets limit and clears the cumulative queue and completion
counts, but leaves adj_limit from the previous queue lifetime. Since
dql_avail() subtracts num_queued from adj_limit, BQL flow control and
qdisc bulk dequeue can use stale credit after a network queue reset,
until the next completion updates adj_limit.

Reset adj_limit to the new limit as well. With num_completed reset to
zero, this restores the documented adj_limit = limit + num_completed
relationship and makes the configured minimum effective immediately.

Fixes: 75957ba36c05 ("dql: Dynamic queue limits")
Cc: stable@vger.kernel.org
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
---
 lib/dynamic_queue_limits.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/dynamic_queue_limits.c b/lib/dynamic_queue_limits.c
index f97a752e900a..acef6a35ba3d 100644
--- a/lib/dynamic_queue_limits.c
+++ b/lib/dynamic_queue_limits.c
@@ -191,6 +191,7 @@ void dql_reset(struct dql *dql)
 {
 	/* Reset all dynamic values */
 	dql->limit = dql->min_limit;
+	dql->adj_limit = dql->limit;
 	dql->num_queued = 0;
 	dql->num_completed = 0;
 	dql->last_obj_cnt = 0;
-- 
2.43.0


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

end of thread, other threads:[~2026-10-20 23:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-20 23:03 [PATCH net] dql: Reset the adjusted limit when resetting the queue Hungyu Lin
2026-10-20 23:13 ` netdev-bot+sinfo

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