[Patch net-next] netpoll: call ->ndo_select_queue() in tx path

Subsystems: networking drivers, networking [general], the rest

STALE5064d REVIEWED: 1 (0M)

1 review trailer.

5 messages, 3 authors, 2012-10-07 · open the first message on its own page

[Patch net-next] netpoll: call ->ndo_select_queue() in tx path

From: Cong Wang <hidden>
Date: 2012-09-18 06:16:46

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

Reported-by: Sylvain Munaut <redacted>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Cong Wang <redacted>
Tested-by: Sylvain Munaut <redacted>

---
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ae3153c0..72661f6 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -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
  */
diff --git a/net/core/dev.c b/net/core/dev.c
index dcc673d..b13317a 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -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
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index dd67818..77a0388 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -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;

Re: [Patch net-next] netpoll: call ->ndo_select_queue() in tx path

From: David Miller <davem@davemloft.net>
Date: 2012-09-19 21:21:10

From: Cong Wang <redacted>
Date: Tue, 18 Sep 2012 14:16:31 +0800
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().

Reported-by: Sylvain Munaut <redacted>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Cong Wang <redacted>
Tested-by: Sylvain Munaut <redacted>
Applied, thanks.

Re: [Patch net-next] netpoll: call ->ndo_select_queue() in tx path

From: Sylvain Munaut <hidden>
Date: 2012-10-03 09:33:23

Hi,
quoted
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().

Reported-by: Sylvain Munaut <redacted>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Cong Wang <redacted>
Tested-by: Sylvain Munaut <redacted>
Applied, thanks.
Huh, I don't see it in the final 3.6 ?
That's rather inconvenient :(

Cheers,

    Sylvain

Re: [Patch net-next] netpoll: call ->ndo_select_queue() in tx path

From: David Miller <davem@davemloft.net>
Date: 2012-10-03 18:39:24

From: Sylvain Munaut <redacted>
Date: Wed, 3 Oct 2012 11:33:22 +0200
Hi,
quoted
quoted
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().

Reported-by: Sylvain Munaut <redacted>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Cong Wang <redacted>
Tested-by: Sylvain Munaut <redacted>
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?

Re: [Patch net-next] netpoll: call ->ndo_select_queue() in tx path

From: Cong Wang <hidden>
Date: 2012-10-07 14:34:37

On Wed, 2012-10-03 at 11:33 +0200, Sylvain Munaut wrote:
Hi,
Hi, Sylvain
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help