diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2018-04-27 14:06:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-29 22:01:33 -0400 |
commit | 1b837d489e06a5289753ddbee99cfbc26d251d6d (patch) | |
tree | 79b017d20c0cc9ad084b4834ae026288b7dd9e1e /net/core/dev.c | |
parent | b86629ebd5447c1e263d89be765ba6fd747c5e4d (diff) |
net: Revoke export for __skb_tx_hash, update it to just be static skb_tx_hash
I am dropping the export of __skb_tx_hash as after my patches nobody is
using it outside of the net/core/dev.c file. In addition I am renaming and
repurposing it to just be a static declaration of skb_tx_hash since that
was the only user for it at this point. By doing this the compiler can
inline it into __netdev_pick_tx as that will improve performance.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 10 |
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); | |||
2615 | * Returns a Tx hash based on the given packet descriptor a Tx queues' number | 2615 | * Returns a Tx hash based on the given packet descriptor a Tx queues' number |
2616 | * to be used as a distribution range. | 2616 | * to be used as a distribution range. |
2617 | */ | 2617 | */ |
2618 | u16 __skb_tx_hash(const struct net_device *dev, struct sk_buff *skb, | 2618 | static u16 skb_tx_hash(const struct net_device *dev, struct sk_buff *skb) |
2619 | unsigned int num_tx_queues) | ||
2620 | { | 2619 | { |
2621 | u32 hash; | 2620 | u32 hash; |
2622 | u16 qoffset = 0; | 2621 | u16 qoffset = 0; |
2623 | u16 qcount = num_tx_queues; | 2622 | u16 qcount = dev->real_num_tx_queues; |
2624 | 2623 | ||
2625 | if (skb_rx_queue_recorded(skb)) { | 2624 | if (skb_rx_queue_recorded(skb)) { |
2626 | hash = skb_get_rx_queue(skb); | 2625 | hash = skb_get_rx_queue(skb); |
2627 | while (unlikely(hash >= num_tx_queues)) | 2626 | while (unlikely(hash >= qcount)) |
2628 | hash -= num_tx_queues; | 2627 | hash -= qcount; |
2629 | return hash; | 2628 | return hash; |
2630 | } | 2629 | } |
2631 | 2630 | ||
@@ -2638,7 +2637,6 @@ u16 __skb_tx_hash(const struct net_device *dev, struct sk_buff *skb, | |||
2638 | 2637 | ||
2639 | return (u16) reciprocal_scale(skb_get_hash(skb), qcount) + qoffset; | 2638 | return (u16) reciprocal_scale(skb_get_hash(skb), qcount) + qoffset; |
2640 | } | 2639 | } |
2641 | EXPORT_SYMBOL(__skb_tx_hash); | ||
2642 | 2640 | ||
2643 | static void skb_warn_bad_offload(const struct sk_buff *skb) | 2641 | static void skb_warn_bad_offload(const struct sk_buff *skb) |
2644 | { | 2642 | { |