From: Paolo Abeni Date: Wed, 10 Apr 2019 12:32:38 +0000 (+0200) Subject: net: sched: prefer qdisc_is_empty() over direct qlen access X-Git-Tag: v5.2-rc1~133^2~204^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1f5e6fdd6aec7929e67afad1e42e35d894a119ae;p=thirdparty%2Fkernel%2Flinux.git net: sched: prefer qdisc_is_empty() over direct qlen access When checking for root qdisc queue length, do not access directly q.qlen. In the following patches we will move back qlen accounting to per CPU values for NOLOCK qdiscs. Instead, prefer the qdisc_is_empty() helper usage. Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller --- diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 0aea0e2624522..7ecb6127e980f 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -747,7 +747,7 @@ static inline bool qdisc_all_tx_empty(const struct net_device *dev) struct netdev_queue *txq = netdev_get_tx_queue(dev, i); const struct Qdisc *q = rcu_dereference(txq->qdisc); - if (q->q.qlen) { + if (!qdisc_is_empty(q)) { rcu_read_unlock(); return false; }