Skip to content

Commit 8c4c49d

Browse files
Amerigo Wangdavem330
authored andcommitted
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>
1 parent 6b6e272 commit 8c4c49d

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

include/linux/netdevice.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,6 +1403,9 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev,
14031403
f(dev, &dev->_tx[i], arg);
14041404
}
14051405

1406+
extern struct netdev_queue *netdev_pick_tx(struct net_device *dev,
1407+
struct sk_buff *skb);
1408+
14061409
/*
14071410
* Net namespace inlines
14081411
*/

net/core/dev.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2396,8 +2396,8 @@ static inline int get_xps_queue(struct net_device *dev, struct sk_buff *skb)
23962396
#endif
23972397
}
23982398

2399-
static struct netdev_queue *dev_pick_tx(struct net_device *dev,
2400-
struct sk_buff *skb)
2399+
struct netdev_queue *netdev_pick_tx(struct net_device *dev,
2400+
struct sk_buff *skb)
24012401
{
24022402
int queue_index;
24032403
const struct net_device_ops *ops = dev->netdev_ops;
@@ -2571,7 +2571,7 @@ int dev_queue_xmit(struct sk_buff *skb)
25712571

25722572
skb_update_prio(skb);
25732573

2574-
txq = dev_pick_tx(dev, skb);
2574+
txq = netdev_pick_tx(dev, skb);
25752575
q = rcu_dereference_bh(txq->qdisc);
25762576

25772577
#ifdef CONFIG_NET_CLS_ACT

net/core/netpoll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
328328
if (skb_queue_len(&npinfo->txq) == 0 && !netpoll_owner_active(dev)) {
329329
struct netdev_queue *txq;
330330

331-
txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb));
331+
txq = netdev_pick_tx(dev, skb);
332332

333333
/* try until next clock tick */
334334
for (tries = jiffies_to_usecs(1)/USEC_PER_POLL;

0 commit comments

Comments
 (0)