Skip to contentSkip to conversation

netpoll: call ->ndo_select_queue() in tx path

PATCH Applied Cong Wang 3 participants 5 messages Sep 18, 2012 – Oct 7, 2012

Subsystems (2)
lore
Share & tools
lore

Cong Wang

author
#0 lore raw

PATCH 1/1 netpoll: call ->ndo_select_queue() in tx path

In netpoll tx path, we miss the chance of calling ->ndo_select_queue(), thus could cause problems when bonding is involved.

This patch makes dev_pick_tx() extern (and rename it to netdev_pick_tx()) to let netpoll call it in netpoll_send_skb_on_dev().

---

include/linux/netdevice.h +3 -0
index ae3153c0..72661f6 100644
@@ -1403,6 +1403,9 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev,
 		f(dev, &dev->_tx[i], arg);
 }
 
+extern struct netdev_queue *netdev_pick_tx(struct net_device *dev,
+					   struct sk_buff *skb);
+
 /*
  * Net namespace inlines
  */
net/core/dev.c +3 -3
index dcc673d..b13317a 100644
@@ -2381,8 +2381,8 @@ static inline int get_xps_queue(struct net_device *dev, struct sk_buff *skb)
 #endif
 }
 
-static struct netdev_queue *dev_pick_tx(struct net_device *dev,
-					struct sk_buff *skb)
+struct netdev_queue *netdev_pick_tx(struct net_device *dev,
+				    struct sk_buff *skb)
 {
 	int queue_index;
 	const struct net_device_ops *ops = dev->netdev_ops;
@@ -2556,7 +2556,7 @@ int dev_queue_xmit(struct sk_buff *skb)
 
 	skb_update_prio(skb);
 
-	txq = dev_pick_tx(dev, skb);
+	txq = netdev_pick_tx(dev, skb);
 	q = rcu_dereference_bh(txq->qdisc);
 
 #ifdef CONFIG_NET_CLS_ACT
net/core/netpoll.c +1 -1
index dd67818..77a0388 100644
@@ -328,7 +328,7 @@ void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
 	if (skb_queue_len(&npinfo->txq) == 0 && !netpoll_owner_active(dev)) {
 		struct netdev_queue *txq;
 
-		txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb));
+		txq = netdev_pick_tx(dev, skb);
 
 		/* try until next clock tick */
 		for (tries = jiffies_to_usecs(1)/USEC_PER_POLL;
maintainer Applied
#1 lore raw

From: Cong Wang <[email protected]>
Date: Tue, 18 Sep 2012 14:16:31 +0800

Quoted 11 lines

In netpoll tx path, we miss the chance of calling ->ndo_select_queue(), thus could cause problems when bonding is involved.

This patch makes dev_pick_tx() extern (and rename it to netdev_pick_tx()) to let netpoll call it in netpoll_send_skb_on_dev().

Applied, thanks.

#2 lore raw

Hi,

Quoted 6 lines
Quoted 6 lines

In netpoll tx path, we miss the chance of calling ->ndo_select_queue(), thus could cause problems when bonding is involved.

This patch makes dev_pick_tx() extern (and rename it to netdev_pick_tx()) to let netpoll call it in netpoll_send_skb_on_dev().

Quoted 7 lines
Quoted 5 lines

Applied, thanks.

Huh, I don't see it in the final 3.6 ?
That's rather inconvenient :(

Cheers,

Sylvain

maintainer
#3 lore raw

From: Sylvain Munaut <[email protected]>
Date: Wed, 3 Oct 2012 11:33:22 +0200

Quoted 14 lines

Hi,

Quoted 12 lines
Quoted 11 lines

In netpoll tx path, we miss the chance of calling ->ndo_select_queue(), thus could cause problems when bonding is involved.

This patch makes dev_pick_tx() extern (and rename it to netdev_pick_tx()) to let netpoll call it in netpoll_send_skb_on_dev().

Quoted 4 lines
Quoted 1 line

Applied, thanks.

Huh, I don't see it in the final 3.6 ?
That's rather inconvenient :(

What part of "net-next" in the subject line do you not understand?

author
#4 lore raw
In reply to Sylvain Munaut
Quoted 2 lines · Sylvain Munaut

Hi,

Hi, Sylvain

Quoted 4 lines

Huh, I don't see it in the final 3.6 ?
That's rather inconvenient :(

We can backport it to 3.6 stable if you request. :)

Thanks.