Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171551
b: refs/heads/master
c: ed04642
h: refs/heads/master
i:
  171549: 2ee2c0c
  171547: 2529c10
  171543: 0292edb
  171535: 3392547
  171519: bfc8620
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Nov 16, 2009
1 parent 919a5a8 commit 99baf54
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9c2b5bdee125d840b2023dcc7625353c8e5bb10c
refs/heads/master: ed04642f753b1240fc65c2978b7365e93209972a
15 changes: 15 additions & 0 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1848,6 +1848,20 @@ u16 skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb)
}
EXPORT_SYMBOL(skb_tx_hash);

static inline u16 dev_cap_txqueue(struct net_device *dev, u16 queue_index)
{
if (unlikely(queue_index >= dev->real_num_tx_queues)) {
if (net_ratelimit()) {
WARN(1, "%s selects TX queue %d, but "
"real number of TX queues is %d\n",
dev->name, queue_index,
dev->real_num_tx_queues);
}
return 0;
}
return queue_index;
}

static struct netdev_queue *dev_pick_tx(struct net_device *dev,
struct sk_buff *skb)
{
Expand All @@ -1861,6 +1875,7 @@ static struct netdev_queue *dev_pick_tx(struct net_device *dev,

if (ops->ndo_select_queue) {
queue_index = ops->ndo_select_queue(dev, skb);
queue_index = dev_cap_txqueue(dev, queue_index);
} else {
queue_index = 0;
if (dev->real_num_tx_queues > 1)
Expand Down

0 comments on commit 99baf54

Please sign in to comment.