OSDN Git Service

mq, mqprio: Use gnet_stats_add_queue().
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Sat, 16 Oct 2021 08:49:04 +0000 (10:49 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Oct 2021 11:54:41 +0000 (12:54 +0100)
commit7361df4606ba5ab6b998f4467496b4bbf4e5526b
treebce92efa5d2b1bb3f0a311e5b630836a001239f4
parent448e163f8b9b2dab4c07c47c9e35c9116dec9489
mq, mqprio: Use gnet_stats_add_queue().

gnet_stats_add_basic() and gnet_stats_add_queue() add up the statistics
so they can be used directly for both the per-CPU and global case.

gnet_stats_add_queue() copies either Qdisc's per-CPU
gnet_stats_queue::qlen or the global member. The global
gnet_stats_queue::qlen isn't touched in the per-CPU case so there is no
need to consider it in the global-case.

In the per-CPU case, the sum of global gnet_stats_queue::qlen and
the per-CPU gnet_stats_queue::qlen was assigned to sch->q.qlen and
sch->qstats.qlen. Now both fields are copied individually.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_mq.c
net/sched/sch_mqprio.c