Commit 1f5e6fdd authored by Paolo Abeni's avatar Paolo Abeni Committed by David S. Miller

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: default avatarPaolo Abeni <pabeni@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b0a231a2
...@@ -747,7 +747,7 @@ static inline bool qdisc_all_tx_empty(const struct net_device *dev) ...@@ -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); struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
const struct Qdisc *q = rcu_dereference(txq->qdisc); const struct Qdisc *q = rcu_dereference(txq->qdisc);
if (q->q.qlen) { if (!qdisc_is_empty(q)) {
rcu_read_unlock(); rcu_read_unlock();
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment