Skip to contentSkip to conversation

net: core: dev: replace state xoff flag comparison by netif_xmit_stopped method

PATCH Superseded [email protected] 2 participants 2 messages Sep 23, 2019 – Sep 25, 2019

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: core: dev: replace state xoff flag comparison by netif_xmit_stopped method

From: Julio Faracco <[email protected]>

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().

---
 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/dev.c +1 -1
index 71b18e8..a8ecf88 100644
@@ -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);
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw

From: [email protected]
Date: Sun, 22 Sep 2019 22:57:29 -0300

Quoted 8 lines

From: Julio Faracco <[email protected]>

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().

net-next is closed, please resubmit when the net-next tree opens back up.

Thank you.