Skip to content

Commit

Permalink
net: sched: prefer qdisc_is_empty() over direct qlen access
Browse files Browse the repository at this point in the history
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 <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Paolo Abeni authored and David S. Miller committed Apr 10, 2019
1 parent b0a231a commit 1f5e6fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/net/sch_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1f5e6fd

Please sign in to comment.