net: sched: fix misuse of qcpu->backlog in gnet_stats_add_queue_cpu
authorZhengchao Shao <shaozhengchao@huawei.com>
Mon, 15 Aug 2022 03:08:48 +0000 (11:08 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 17 Aug 2022 02:38:20 +0000 (19:38 -0700)
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>
net/core/gen_stats.c

index a10335b4ba2d0bf55fc5d4bbdf50b88743152f45..c8d137ef5980eaf6e1c3ea10417e096bf2a33849 100644 (file)
@@ -345,7 +345,7 @@ static void gnet_stats_add_queue_cpu(struct gnet_stats_queue *qstats,
        for_each_possible_cpu(i) {
                const struct gnet_stats_queue *qcpu = per_cpu_ptr(q, i);
 
-               qstats->qlen += qcpu->backlog;
+               qstats->qlen += qcpu->qlen;
                qstats->backlog += qcpu->backlog;
                qstats->drops += qcpu->drops;
                qstats->requeues += qcpu->requeues;