[PATCH v1] wifi: mac80211: fix swapped fq_overlimit/fq_overmemory in aqm debugfs

Julius Bairaktaris <[email protected]>
Newsgroups org.kernel.vger.linux-wireless
Message-ID <[email protected]>
The aqm file prints fq_overlimit with fq->overmemory and fq_overmemory
with fq->overlimit. The fq_overmemory line was added to the format string
after fq_overlimit while its argument went in before it, and the two have
been crossed since.

The counters are not interchangeable: fq_tin_enqueue() bumps fq->overlimit
for every packet the eviction loop drops, and fq->overmemory only for the
subset dropped because the memory limit was exceeded, so overmemory is
always the smaller of the two. Reading the file to tell which limit is
binding gives the opposite answer.

Fixes: 2a4e675d887b ("mac80211: Export fq memory limit information in debugfs")
Assisted-by: Claude:claude-opus-5
Signed-off-by: Julius Bairaktaris <[email protected]>
---
 net/mac80211/debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
index a4d5461f6480..014f3c872706 100644
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -96,8 +96,8 @@ static ssize_t aqm_read(struct file *file,
 			"RW fq_quantum %u\n",
 			fq->flows_cnt,
 			fq->backlog,
-			fq->overmemory,
 			fq->overlimit,
+			fq->overmemory,
 			fq->collisions,
 			fq->memory_usage,
 			fq->memory_limit,
-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.