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(). Reported-by: Sylvain Munaut <s.munaut@whatever-company.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Eric Dumazet <edumazet@google.com> Signed-off-by: Cong Wang <amwang@redhat.com> Tested-by: Sylvain Munaut <s.munaut@whatever-company.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
6b6e27255f
commit
8c4c49df5c
@ -1403,6 +1403,9 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev,
|
|||||||
f(dev, &dev->_tx[i], arg);
|
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 namespace inlines
|
||||||
*/
|
*/
|
||||||
|
@ -2396,7 +2396,7 @@ static inline int get_xps_queue(struct net_device *dev, struct sk_buff *skb)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct netdev_queue *dev_pick_tx(struct net_device *dev,
|
struct netdev_queue *netdev_pick_tx(struct net_device *dev,
|
||||||
struct sk_buff *skb)
|
struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
int queue_index;
|
int queue_index;
|
||||||
@ -2571,7 +2571,7 @@ int dev_queue_xmit(struct sk_buff *skb)
|
|||||||
|
|
||||||
skb_update_prio(skb);
|
skb_update_prio(skb);
|
||||||
|
|
||||||
txq = dev_pick_tx(dev, skb);
|
txq = netdev_pick_tx(dev, skb);
|
||||||
q = rcu_dereference_bh(txq->qdisc);
|
q = rcu_dereference_bh(txq->qdisc);
|
||||||
|
|
||||||
#ifdef CONFIG_NET_CLS_ACT
|
#ifdef CONFIG_NET_CLS_ACT
|
||||||
|
@ -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)) {
|
if (skb_queue_len(&npinfo->txq) == 0 && !netpoll_owner_active(dev)) {
|
||||||
struct netdev_queue *txq;
|
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 */
|
/* try until next clock tick */
|
||||||
for (tries = jiffies_to_usecs(1)/USEC_PER_POLL;
|
for (tries = jiffies_to_usecs(1)/USEC_PER_POLL;
|
||||||
|
Loading…
Reference in New Issue
Block a user