Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: sched: fix misuse of qcpu->backlog in gnet_stats_add_queue_cpu

In the gnet_stats_add_queue_cpu function, the qstats->qlen statistics
are incorrectly set to qcpu->backlog.

Fixes: 448e163f8b9b ("gen_stats: Add gnet_stats_add_queue()")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Link: https://lore.kernel.org/r/20220815030848.276746-1-shaozhengchao@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Zhengchao Shao and committed by
Jakub Kicinski
de64b6b6 ae806c78

+1 -1
+1 -1
net/core/gen_stats.c
··· 345 345 for_each_possible_cpu(i) { 346 346 const struct gnet_stats_queue *qcpu = per_cpu_ptr(q, i); 347 347 348 - qstats->qlen += qcpu->backlog; 348 + qstats->qlen += qcpu->qlen; 349 349 qstats->backlog += qcpu->backlog; 350 350 qstats->drops += qcpu->drops; 351 351 qstats->requeues += qcpu->requeues;