From: Julio Faracco <jcfara...@gmail.com>

Function netif_schedule_queue() has a hardcoded comparison between queue
state and any xoff flag. This comparison does the same thing as method
netif_xmit_stopped(). In terms of code clarity, it is better. See other
methods like: generic_xdp_tx() and dev_direct_xmit().

Signed-off-by: Julio Faracco <jcfara...@gmail.com>
---
Resubmitted as a V2 because V1 was sent during net-next closed window.
This commit message and change have the same structure as V1.
---
 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index bf3ed413abaf..21a9c2987cbb 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2771,7 +2771,7 @@ static struct dev_kfree_skb_cb *get_kfree_skb_cb(const 
struct sk_buff *skb)
 void netif_schedule_queue(struct netdev_queue *txq)
 {
        rcu_read_lock();
-       if (!(txq->state & QUEUE_STATE_ANY_XOFF)) {
+       if (!netif_xmit_stopped(txq)) {
                struct Qdisc *q = rcu_dereference(txq->qdisc);
 
                __netif_schedule(q);
-- 
2.17.1

Reply via email to