summaryrefslogtreecommitdiff
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-04-29 22:01:33 -0400
committerDavid S. Miller <davem@davemloft.net>2018-04-29 22:01:33 -0400
commitc1b28847f7c00906a765516e8291ea2a71add64b (patch)
tree79b017d20c0cc9ad084b4834ae026288b7dd9e1e /net/core/dev.c
parentf90652841f38886c2d70100a9c613ccaabf56465 (diff)
parent1b837d489e06a5289753ddbee99cfbc26d251d6d (diff)
Merge branch 'net-cleanup-skb_tx_hash'
Alexander Duyck says: ==================== Clean up users of skb_tx_hash and __skb_tx_hash I am in the process of doing some work to try and enable macvlan Tx queue selection without using ndo_select_queue. As a part of that I will likely need to make changes to skb_tx_hash. As such this is a clean up or refactor of the two spots where he function has been used. In both cases it didn't really seem like the function was being used correctly so I have updated both code paths to not make use of the function. My current development environment doesn't have an mlx4 or OPA vnic available so the changes to those have been build tested only. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 0a2d46424069..25ceecfdd8fe 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2615,17 +2615,16 @@ EXPORT_SYMBOL(netif_device_attach);
* Returns a Tx hash based on the given packet descriptor a Tx queues' number
* to be used as a distribution range.
*/
-u16 __skb_tx_hash(const struct net_device *dev, struct sk_buff *skb,
- unsigned int num_tx_queues)
+static u16 skb_tx_hash(const struct net_device *dev, struct sk_buff *skb)
{
u32 hash;
u16 qoffset = 0;
- u16 qcount = num_tx_queues;
+ u16 qcount = dev->real_num_tx_queues;
if (skb_rx_queue_recorded(skb)) {
hash = skb_get_rx_queue(skb);
- while (unlikely(hash >= num_tx_queues))
- hash -= num_tx_queues;
+ while (unlikely(hash >= qcount))
+ hash -= qcount;
return hash;
}
@@ -2638,7 +2637,6 @@ u16 __skb_tx_hash(const struct net_device *dev, struct sk_buff *skb,
return (u16) reciprocal_scale(skb_get_hash(skb), qcount) + qoffset;
}
-EXPORT_SYMBOL(__skb_tx_hash);
static void skb_warn_bad_offload(const struct sk_buff *skb)
{