summaryrefslogtreecommitdiffstats
path: root/include/net/sch_generic.h
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2021-10-16 10:49:05 +0200
committerDavid S. Miller <davem@davemloft.net>2021-10-18 13:54:41 +0200
commit10940eb746d417734fb9e5eba6df927e593e4f13 (patch)
tree63e85df8de94f6d47558bc2b18bf2da95ce804e6 /include/net/sch_generic.h
parentmq, mqprio: Use gnet_stats_add_queue(). (diff)
downloadlinux-10940eb746d417734fb9e5eba6df927e593e4f13.tar.xz
linux-10940eb746d417734fb9e5eba6df927e593e4f13.zip
gen_stats: Move remaining users to gnet_stats_add_queue().
The gnet_stats_queue::qlen member is only used in the SMP-case. qdisc_qstats_qlen_backlog() needs to add qdisc_qlen() to qstats.qlen to have the same value as that provided by qdisc_qlen_sum(). gnet_stats_copy_queue() needs to overwritte the resulting qstats.qlen field whith the caller submitted qlen value. It might be differ from the submitted value. Let both functions use gnet_stats_add_queue() and remove unused __gnet_stats_copy_queue(). Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sch_generic.h')
-rw-r--r--include/net/sch_generic.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 5a011f8d394e..7bc2d30b5c06 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -972,10 +972,9 @@ static inline void qdisc_qstats_qlen_backlog(struct Qdisc *sch, __u32 *qlen,
__u32 *backlog)
{
struct gnet_stats_queue qstats = { 0 };
- __u32 len = qdisc_qlen_sum(sch);
- __gnet_stats_copy_queue(&qstats, sch->cpu_qstats, &sch->qstats, len);
- *qlen = qstats.qlen;
+ gnet_stats_add_queue(&qstats, sch->cpu_qstats, &sch->qstats);
+ *qlen = qstats.qlen + qdisc_qlen(sch);
*backlog = qstats.backlog;
}