Skip to content

Commit 1f5e6fd

Browse files
Paolo Abenidavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b0a231a commit 1f5e6fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/net/sch_generic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ static inline bool qdisc_all_tx_empty(const struct net_device *dev)
747747
struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
748748
const struct Qdisc *q = rcu_dereference(txq->qdisc);
749749

750-
if (q->q.qlen) {
750+
if (!qdisc_is_empty(q)) {
751751
rcu_read_unlock();
752752
return false;
753753
}

0 commit comments

Comments
 (0)