diff options
-rw-r--r-- | include/linux/netdevice.h | 6 | ||||
-rw-r--r-- | net/core/netpoll.c | 2 | ||||
-rw-r--r-- | net/core/pktgen.c | 4 | ||||
-rw-r--r-- | net/packet/af_packet.c | 4 | ||||
-rw-r--r-- | net/sched/sch_generic.c | 6 |
5 files changed, 13 insertions, 9 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 429801370d0c..dfc1d8b8bd0f 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1747,6 +1747,12 @@ struct netdev_queue *netdev_get_tx_queue(const struct net_device *dev, | |||
1747 | return &dev->_tx[index]; | 1747 | return &dev->_tx[index]; |
1748 | } | 1748 | } |
1749 | 1749 | ||
1750 | static inline struct netdev_queue *skb_get_tx_queue(const struct net_device *dev, | ||
1751 | const struct sk_buff *skb) | ||
1752 | { | ||
1753 | return netdev_get_tx_queue(dev, skb_get_queue_mapping(skb)); | ||
1754 | } | ||
1755 | |||
1750 | static inline void netdev_for_each_tx_queue(struct net_device *dev, | 1756 | static inline void netdev_for_each_tx_queue(struct net_device *dev, |
1751 | void (*f)(struct net_device *, | 1757 | void (*f)(struct net_device *, |
1752 | struct netdev_queue *, | 1758 | struct netdev_queue *, |
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index a5ad06828d67..12b1df976562 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -115,7 +115,7 @@ static void queue_process(struct work_struct *work) | |||
115 | continue; | 115 | continue; |
116 | } | 116 | } |
117 | 117 | ||
118 | txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb)); | 118 | txq = skb_get_tx_queue(dev, skb); |
119 | 119 | ||
120 | local_irq_save(flags); | 120 | local_irq_save(flags); |
121 | HARD_TX_LOCK(dev, txq, smp_processor_id()); | 121 | HARD_TX_LOCK(dev, txq, smp_processor_id()); |
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 83e2b4b19eb7..d81b540096c3 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -3286,7 +3286,6 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev) | |||
3286 | { | 3286 | { |
3287 | struct net_device *odev = pkt_dev->odev; | 3287 | struct net_device *odev = pkt_dev->odev; |
3288 | struct netdev_queue *txq; | 3288 | struct netdev_queue *txq; |
3289 | u16 queue_map; | ||
3290 | int ret; | 3289 | int ret; |
3291 | 3290 | ||
3292 | /* If device is offline, then don't send */ | 3291 | /* If device is offline, then don't send */ |
@@ -3324,8 +3323,7 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev) | |||
3324 | if (pkt_dev->delay && pkt_dev->last_ok) | 3323 | if (pkt_dev->delay && pkt_dev->last_ok) |
3325 | spin(pkt_dev, pkt_dev->next_tx); | 3324 | spin(pkt_dev, pkt_dev->next_tx); |
3326 | 3325 | ||
3327 | queue_map = skb_get_queue_mapping(pkt_dev->skb); | 3326 | txq = skb_get_tx_queue(odev, pkt_dev->skb); |
3328 | txq = netdev_get_tx_queue(odev, queue_map); | ||
3329 | 3327 | ||
3330 | local_bh_disable(); | 3328 | local_bh_disable(); |
3331 | 3329 | ||
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 0dfa990d4eaa..b7a7f5a721bd 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -243,7 +243,6 @@ static int packet_direct_xmit(struct sk_buff *skb) | |||
243 | netdev_features_t features; | 243 | netdev_features_t features; |
244 | struct netdev_queue *txq; | 244 | struct netdev_queue *txq; |
245 | int ret = NETDEV_TX_BUSY; | 245 | int ret = NETDEV_TX_BUSY; |
246 | u16 queue_map; | ||
247 | 246 | ||
248 | if (unlikely(!netif_running(dev) || | 247 | if (unlikely(!netif_running(dev) || |
249 | !netif_carrier_ok(dev))) | 248 | !netif_carrier_ok(dev))) |
@@ -254,8 +253,7 @@ static int packet_direct_xmit(struct sk_buff *skb) | |||
254 | __skb_linearize(skb)) | 253 | __skb_linearize(skb)) |
255 | goto drop; | 254 | goto drop; |
256 | 255 | ||
257 | queue_map = skb_get_queue_mapping(skb); | 256 | txq = skb_get_tx_queue(dev, skb); |
258 | txq = netdev_get_tx_queue(dev, queue_map); | ||
259 | 257 | ||
260 | local_bh_disable(); | 258 | local_bh_disable(); |
261 | 259 | ||
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index fc04fe93c2da..05b3f5d104af 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
@@ -63,7 +63,7 @@ static inline struct sk_buff *dequeue_skb(struct Qdisc *q) | |||
63 | 63 | ||
64 | if (unlikely(skb)) { | 64 | if (unlikely(skb)) { |
65 | /* check the reason of requeuing without tx lock first */ | 65 | /* check the reason of requeuing without tx lock first */ |
66 | txq = netdev_get_tx_queue(txq->dev, skb_get_queue_mapping(skb)); | 66 | txq = skb_get_tx_queue(txq->dev, skb); |
67 | if (!netif_xmit_frozen_or_stopped(txq)) { | 67 | if (!netif_xmit_frozen_or_stopped(txq)) { |
68 | q->gso_skb = NULL; | 68 | q->gso_skb = NULL; |
69 | q->q.qlen--; | 69 | q->q.qlen--; |
@@ -183,10 +183,12 @@ static inline int qdisc_restart(struct Qdisc *q) | |||
183 | skb = dequeue_skb(q); | 183 | skb = dequeue_skb(q); |
184 | if (unlikely(!skb)) | 184 | if (unlikely(!skb)) |
185 | return 0; | 185 | return 0; |
186 | |||
186 | WARN_ON_ONCE(skb_dst_is_noref(skb)); | 187 | WARN_ON_ONCE(skb_dst_is_noref(skb)); |
188 | |||
187 | root_lock = qdisc_lock(q); | 189 | root_lock = qdisc_lock(q); |
188 | dev = qdisc_dev(q); | 190 | dev = qdisc_dev(q); |
189 | txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb)); | 191 | txq = skb_get_tx_queue(dev, skb); |
190 | 192 | ||
191 | return sch_direct_xmit(skb, q, dev, txq, root_lock); | 193 | return sch_direct_xmit(skb, q, dev, txq, root_lock); |
192 | } | 194 | } |