From: Jakub Kicinski Date: Sat, 26 May 2018 04:53:30 +0000 (-0700) Subject: net: sched: add qstats.qlen to qlen X-Git-Tag: v4.18-rc1~114^2~114^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6172abc1e2ea12743f368875576952ddf4ebe88c;p=thirdparty%2Fkernel%2Flinux.git net: sched: add qstats.qlen to qlen AFAICT struct gnet_stats_queue.qlen is not used in Qdiscs. It may, however, be useful for offloads to report HW queue length there. Add that value to the result of qdisc_qlen_sum(). Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller --- diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 827a3711dc688..6488daa32f829 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -350,14 +350,14 @@ static inline int qdisc_qlen(const struct Qdisc *q) static inline int qdisc_qlen_sum(const struct Qdisc *q) { - __u32 qlen = 0; + __u32 qlen = q->qstats.qlen; int i; if (q->flags & TCQ_F_NOLOCK) { for_each_possible_cpu(i) qlen += per_cpu_ptr(q->cpu_qstats, i)->qlen; } else { - qlen = q->q.qlen; + qlen += q->q.qlen; } return qlen;