diff options
| -rw-r--r-- | net/core/netpoll.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 53599bd0c82d..457f882b0f7b 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
| @@ -105,15 +105,21 @@ static void queue_process(struct work_struct *work) | |||
| 105 | while ((skb = skb_dequeue(&npinfo->txq))) { | 105 | while ((skb = skb_dequeue(&npinfo->txq))) { |
| 106 | struct net_device *dev = skb->dev; | 106 | struct net_device *dev = skb->dev; |
| 107 | struct netdev_queue *txq; | 107 | struct netdev_queue *txq; |
| 108 | unsigned int q_index; | ||
| 108 | 109 | ||
| 109 | if (!netif_device_present(dev) || !netif_running(dev)) { | 110 | if (!netif_device_present(dev) || !netif_running(dev)) { |
| 110 | kfree_skb(skb); | 111 | kfree_skb(skb); |
| 111 | continue; | 112 | continue; |
| 112 | } | 113 | } |
| 113 | 114 | ||
| 114 | txq = skb_get_tx_queue(dev, skb); | ||
| 115 | |||
| 116 | local_irq_save(flags); | 115 | local_irq_save(flags); |
| 116 | /* check if skb->queue_mapping is still valid */ | ||
| 117 | q_index = skb_get_queue_mapping(skb); | ||
| 118 | if (unlikely(q_index >= dev->real_num_tx_queues)) { | ||
| 119 | q_index = q_index % dev->real_num_tx_queues; | ||
| 120 | skb_set_queue_mapping(skb, q_index); | ||
| 121 | } | ||
| 122 | txq = netdev_get_tx_queue(dev, q_index); | ||
| 117 | HARD_TX_LOCK(dev, txq, smp_processor_id()); | 123 | HARD_TX_LOCK(dev, txq, smp_processor_id()); |
| 118 | if (netif_xmit_frozen_or_stopped(txq) || | 124 | if (netif_xmit_frozen_or_stopped(txq) || |
| 119 | netpoll_start_xmit(skb, dev, txq) != NETDEV_TX_OK) { | 125 | netpoll_start_xmit(skb, dev, txq) != NETDEV_TX_OK) { |
