Netdev List
 help / color / mirror / Atom feed
From: Hungyu Lin <dennylin0707@gmail.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Hungyu Lin <dennylin0707@gmail.com>
Subject: [PATCH net] dql: Reset the adjusted limit when resetting the queue
Date: Tue, 20 Oct 2026 23:03:58 +0000	[thread overview]
Message-ID: <20261020230358.6649-1-dennylin0707@gmail.com> (raw)

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


             reply	other threads:[~2026-10-20 23:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20 23:03 Hungyu Lin [this message]
2026-10-20 23:13 ` [PATCH net] dql: Reset the adjusted limit when resetting the queue netdev-bot+sinfo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261020230358.6649-1-dennylin0707@gmail.com \
    --to=dennylin0707@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox