diff options
author | Tom Herbert <therbert@google.com> | 2014-03-24 18:34:47 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-26 15:58:20 -0400 |
commit | 61b905da33ae25edb6b9d2a5de21e34c3a77efe3 (patch) | |
tree | 74990d790d603e989210b0221703910d9beef4f1 | |
parent | 4e2e865d959e095ab8f1a112e7952c9baa173d0a (diff) |
net: Rename skb->rxhash to skb->hash
The packet hash can be considered a property of the packet, not just
on RX path.
This patch changes name of rxhash and l4_rxhash skbuff fields to be
hash and l4_hash respectively. This includes changing uses of the
field in the code which don't call the access functions.
Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Mahesh Bandewar <maheshb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | arch/arm/net/bpf_jit_32.c | 4 | ||||
-rw-r--r-- | arch/powerpc/net/bpf_jit_comp.c | 4 | ||||
-rw-r--r-- | arch/s390/net/bpf_jit_comp.c | 8 | ||||
-rw-r--r-- | arch/sparc/net/bpf_jit_comp.c | 2 | ||||
-rw-r--r-- | arch/x86/net/bpf_jit_comp.c | 8 | ||||
-rw-r--r-- | include/linux/skbuff.h | 28 | ||||
-rw-r--r-- | include/net/sock.h | 4 | ||||
-rw-r--r-- | include/trace/events/net.h | 12 | ||||
-rw-r--r-- | net/core/dev.c | 13 | ||||
-rw-r--r-- | net/core/filter.c | 2 | ||||
-rw-r--r-- | net/core/flow_dissector.c | 10 | ||||
-rw-r--r-- | net/packet/af_packet.c | 3 |
12 files changed, 49 insertions, 49 deletions
diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index 271b5e971568..7ddb9c83cdfc 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/arm/net/bpf_jit_32.c | |||
@@ -825,8 +825,8 @@ b_epilogue: | |||
825 | break; | 825 | break; |
826 | case BPF_S_ANC_RXHASH: | 826 | case BPF_S_ANC_RXHASH: |
827 | ctx->seen |= SEEN_SKB; | 827 | ctx->seen |= SEEN_SKB; |
828 | BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, rxhash) != 4); | 828 | BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, hash) != 4); |
829 | off = offsetof(struct sk_buff, rxhash); | 829 | off = offsetof(struct sk_buff, hash); |
830 | emit(ARM_LDR_I(r_A, r_skb, off), ctx); | 830 | emit(ARM_LDR_I(r_A, r_skb, off), ctx); |
831 | break; | 831 | break; |
832 | case BPF_S_ANC_VLAN_TAG: | 832 | case BPF_S_ANC_VLAN_TAG: |
diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c index 555034f8505e..4afad6c17d50 100644 --- a/arch/powerpc/net/bpf_jit_comp.c +++ b/arch/powerpc/net/bpf_jit_comp.c | |||
@@ -390,9 +390,9 @@ static int bpf_jit_build_body(struct sk_filter *fp, u32 *image, | |||
390 | mark)); | 390 | mark)); |
391 | break; | 391 | break; |
392 | case BPF_S_ANC_RXHASH: | 392 | case BPF_S_ANC_RXHASH: |
393 | BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, rxhash) != 4); | 393 | BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, hash) != 4); |
394 | PPC_LWZ_OFFS(r_A, r_skb, offsetof(struct sk_buff, | 394 | PPC_LWZ_OFFS(r_A, r_skb, offsetof(struct sk_buff, |
395 | rxhash)); | 395 | hash)); |
396 | break; | 396 | break; |
397 | case BPF_S_ANC_VLAN_TAG: | 397 | case BPF_S_ANC_VLAN_TAG: |
398 | case BPF_S_ANC_VLAN_TAG_PRESENT: | 398 | case BPF_S_ANC_VLAN_TAG_PRESENT: |
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c index 708d60e40066..153f8f2cfd56 100644 --- a/arch/s390/net/bpf_jit_comp.c +++ b/arch/s390/net/bpf_jit_comp.c | |||
@@ -737,10 +737,10 @@ call_fn: /* lg %r1,<d(function)>(%r13) */ | |||
737 | /* icm %r5,3,<d(type)>(%r1) */ | 737 | /* icm %r5,3,<d(type)>(%r1) */ |
738 | EMIT4_DISP(0xbf531000, offsetof(struct net_device, type)); | 738 | EMIT4_DISP(0xbf531000, offsetof(struct net_device, type)); |
739 | break; | 739 | break; |
740 | case BPF_S_ANC_RXHASH: /* A = skb->rxhash */ | 740 | case BPF_S_ANC_RXHASH: /* A = skb->hash */ |
741 | BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, rxhash) != 4); | 741 | BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, hash) != 4); |
742 | /* l %r5,<d(rxhash)>(%r2) */ | 742 | /* l %r5,<d(hash)>(%r2) */ |
743 | EMIT4_DISP(0x58502000, offsetof(struct sk_buff, rxhash)); | 743 | EMIT4_DISP(0x58502000, offsetof(struct sk_buff, hash)); |
744 | break; | 744 | break; |
745 | case BPF_S_ANC_VLAN_TAG: | 745 | case BPF_S_ANC_VLAN_TAG: |
746 | case BPF_S_ANC_VLAN_TAG_PRESENT: | 746 | case BPF_S_ANC_VLAN_TAG_PRESENT: |
diff --git a/arch/sparc/net/bpf_jit_comp.c b/arch/sparc/net/bpf_jit_comp.c index 01fe9946d388..d96d2a7c78ee 100644 --- a/arch/sparc/net/bpf_jit_comp.c +++ b/arch/sparc/net/bpf_jit_comp.c | |||
@@ -618,7 +618,7 @@ void bpf_jit_compile(struct sk_filter *fp) | |||
618 | emit_load16(r_A, struct net_device, type, r_A); | 618 | emit_load16(r_A, struct net_device, type, r_A); |
619 | break; | 619 | break; |
620 | case BPF_S_ANC_RXHASH: | 620 | case BPF_S_ANC_RXHASH: |
621 | emit_skb_load32(rxhash, r_A); | 621 | emit_skb_load32(hash, r_A); |
622 | break; | 622 | break; |
623 | case BPF_S_ANC_VLAN_TAG: | 623 | case BPF_S_ANC_VLAN_TAG: |
624 | case BPF_S_ANC_VLAN_TAG_PRESENT: | 624 | case BPF_S_ANC_VLAN_TAG_PRESENT: |
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c index 4ed75dd81d05..293c57b74edc 100644 --- a/arch/x86/net/bpf_jit_comp.c +++ b/arch/x86/net/bpf_jit_comp.c | |||
@@ -553,13 +553,13 @@ void bpf_jit_compile(struct sk_filter *fp) | |||
553 | } | 553 | } |
554 | break; | 554 | break; |
555 | case BPF_S_ANC_RXHASH: | 555 | case BPF_S_ANC_RXHASH: |
556 | BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, rxhash) != 4); | 556 | BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, hash) != 4); |
557 | if (is_imm8(offsetof(struct sk_buff, rxhash))) { | 557 | if (is_imm8(offsetof(struct sk_buff, hash))) { |
558 | /* mov off8(%rdi),%eax */ | 558 | /* mov off8(%rdi),%eax */ |
559 | EMIT3(0x8b, 0x47, offsetof(struct sk_buff, rxhash)); | 559 | EMIT3(0x8b, 0x47, offsetof(struct sk_buff, hash)); |
560 | } else { | 560 | } else { |
561 | EMIT2(0x8b, 0x87); | 561 | EMIT2(0x8b, 0x87); |
562 | EMIT(offsetof(struct sk_buff, rxhash), 4); | 562 | EMIT(offsetof(struct sk_buff, hash), 4); |
563 | } | 563 | } |
564 | break; | 564 | break; |
565 | case BPF_S_ANC_QUEUE: | 565 | case BPF_S_ANC_QUEUE: |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 03db95ab8a8c..aa2c22cb8158 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -444,11 +444,11 @@ static inline u32 skb_mstamp_us_delta(const struct skb_mstamp *t1, | |||
444 | * @skb_iif: ifindex of device we arrived on | 444 | * @skb_iif: ifindex of device we arrived on |
445 | * @tc_index: Traffic control index | 445 | * @tc_index: Traffic control index |
446 | * @tc_verd: traffic control verdict | 446 | * @tc_verd: traffic control verdict |
447 | * @rxhash: the packet hash computed on receive | 447 | * @hash: the packet hash |
448 | * @queue_mapping: Queue mapping for multiqueue devices | 448 | * @queue_mapping: Queue mapping for multiqueue devices |
449 | * @ndisc_nodetype: router type (from link layer) | 449 | * @ndisc_nodetype: router type (from link layer) |
450 | * @ooo_okay: allow the mapping of a socket to a queue to be changed | 450 | * @ooo_okay: allow the mapping of a socket to a queue to be changed |
451 | * @l4_rxhash: indicate rxhash is a canonical 4-tuple hash over transport | 451 | * @l4_hash: indicate hash is a canonical 4-tuple hash over transport |
452 | * ports. | 452 | * ports. |
453 | * @wifi_acked_valid: wifi_acked was set | 453 | * @wifi_acked_valid: wifi_acked was set |
454 | * @wifi_acked: whether frame was acked on wifi or not | 454 | * @wifi_acked: whether frame was acked on wifi or not |
@@ -537,7 +537,7 @@ struct sk_buff { | |||
537 | 537 | ||
538 | int skb_iif; | 538 | int skb_iif; |
539 | 539 | ||
540 | __u32 rxhash; | 540 | __u32 hash; |
541 | 541 | ||
542 | __be16 vlan_proto; | 542 | __be16 vlan_proto; |
543 | __u16 vlan_tci; | 543 | __u16 vlan_tci; |
@@ -556,7 +556,7 @@ struct sk_buff { | |||
556 | #endif | 556 | #endif |
557 | __u8 pfmemalloc:1; | 557 | __u8 pfmemalloc:1; |
558 | __u8 ooo_okay:1; | 558 | __u8 ooo_okay:1; |
559 | __u8 l4_rxhash:1; | 559 | __u8 l4_hash:1; |
560 | __u8 wifi_acked_valid:1; | 560 | __u8 wifi_acked_valid:1; |
561 | __u8 wifi_acked:1; | 561 | __u8 wifi_acked:1; |
562 | __u8 no_fcs:1; | 562 | __u8 no_fcs:1; |
@@ -815,40 +815,40 @@ enum pkt_hash_types { | |||
815 | static inline void | 815 | static inline void |
816 | skb_set_hash(struct sk_buff *skb, __u32 hash, enum pkt_hash_types type) | 816 | skb_set_hash(struct sk_buff *skb, __u32 hash, enum pkt_hash_types type) |
817 | { | 817 | { |
818 | skb->l4_rxhash = (type == PKT_HASH_TYPE_L4); | 818 | skb->l4_hash = (type == PKT_HASH_TYPE_L4); |
819 | skb->rxhash = hash; | 819 | skb->hash = hash; |
820 | } | 820 | } |
821 | 821 | ||
822 | void __skb_get_hash(struct sk_buff *skb); | 822 | void __skb_get_hash(struct sk_buff *skb); |
823 | static inline __u32 skb_get_hash(struct sk_buff *skb) | 823 | static inline __u32 skb_get_hash(struct sk_buff *skb) |
824 | { | 824 | { |
825 | if (!skb->l4_rxhash) | 825 | if (!skb->l4_hash) |
826 | __skb_get_hash(skb); | 826 | __skb_get_hash(skb); |
827 | 827 | ||
828 | return skb->rxhash; | 828 | return skb->hash; |
829 | } | 829 | } |
830 | 830 | ||
831 | static inline __u32 skb_get_hash_raw(const struct sk_buff *skb) | 831 | static inline __u32 skb_get_hash_raw(const struct sk_buff *skb) |
832 | { | 832 | { |
833 | return skb->rxhash; | 833 | return skb->hash; |
834 | } | 834 | } |
835 | 835 | ||
836 | static inline void skb_clear_hash(struct sk_buff *skb) | 836 | static inline void skb_clear_hash(struct sk_buff *skb) |
837 | { | 837 | { |
838 | skb->rxhash = 0; | 838 | skb->hash = 0; |
839 | skb->l4_rxhash = 0; | 839 | skb->l4_hash = 0; |
840 | } | 840 | } |
841 | 841 | ||
842 | static inline void skb_clear_hash_if_not_l4(struct sk_buff *skb) | 842 | static inline void skb_clear_hash_if_not_l4(struct sk_buff *skb) |
843 | { | 843 | { |
844 | if (!skb->l4_rxhash) | 844 | if (!skb->l4_hash) |
845 | skb_clear_hash(skb); | 845 | skb_clear_hash(skb); |
846 | } | 846 | } |
847 | 847 | ||
848 | static inline void skb_copy_hash(struct sk_buff *to, const struct sk_buff *from) | 848 | static inline void skb_copy_hash(struct sk_buff *to, const struct sk_buff *from) |
849 | { | 849 | { |
850 | to->rxhash = from->rxhash; | 850 | to->hash = from->hash; |
851 | to->l4_rxhash = from->l4_rxhash; | 851 | to->l4_hash = from->l4_hash; |
852 | }; | 852 | }; |
853 | 853 | ||
854 | #ifdef NET_SKBUFF_DATA_USES_OFFSET | 854 | #ifdef NET_SKBUFF_DATA_USES_OFFSET |
diff --git a/include/net/sock.h b/include/net/sock.h index 625e65b12366..8d7c431a0660 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -862,9 +862,9 @@ static inline void sock_rps_save_rxhash(struct sock *sk, | |||
862 | const struct sk_buff *skb) | 862 | const struct sk_buff *skb) |
863 | { | 863 | { |
864 | #ifdef CONFIG_RPS | 864 | #ifdef CONFIG_RPS |
865 | if (unlikely(sk->sk_rxhash != skb->rxhash)) { | 865 | if (unlikely(sk->sk_rxhash != skb->hash)) { |
866 | sock_rps_reset_flow(sk); | 866 | sock_rps_reset_flow(sk); |
867 | sk->sk_rxhash = skb->rxhash; | 867 | sk->sk_rxhash = skb->hash; |
868 | } | 868 | } |
869 | #endif | 869 | #endif |
870 | } | 870 | } |
diff --git a/include/trace/events/net.h b/include/trace/events/net.h index a34f27b2e394..1de256b35807 100644 --- a/include/trace/events/net.h +++ b/include/trace/events/net.h | |||
@@ -153,8 +153,8 @@ DECLARE_EVENT_CLASS(net_dev_rx_verbose_template, | |||
153 | __field( u16, vlan_tci ) | 153 | __field( u16, vlan_tci ) |
154 | __field( u16, protocol ) | 154 | __field( u16, protocol ) |
155 | __field( u8, ip_summed ) | 155 | __field( u8, ip_summed ) |
156 | __field( u32, rxhash ) | 156 | __field( u32, hash ) |
157 | __field( bool, l4_rxhash ) | 157 | __field( bool, l4_hash ) |
158 | __field( unsigned int, len ) | 158 | __field( unsigned int, len ) |
159 | __field( unsigned int, data_len ) | 159 | __field( unsigned int, data_len ) |
160 | __field( unsigned int, truesize ) | 160 | __field( unsigned int, truesize ) |
@@ -179,8 +179,8 @@ DECLARE_EVENT_CLASS(net_dev_rx_verbose_template, | |||
179 | __entry->vlan_tci = vlan_tx_tag_get(skb); | 179 | __entry->vlan_tci = vlan_tx_tag_get(skb); |
180 | __entry->protocol = ntohs(skb->protocol); | 180 | __entry->protocol = ntohs(skb->protocol); |
181 | __entry->ip_summed = skb->ip_summed; | 181 | __entry->ip_summed = skb->ip_summed; |
182 | __entry->rxhash = skb->rxhash; | 182 | __entry->hash = skb->hash; |
183 | __entry->l4_rxhash = skb->l4_rxhash; | 183 | __entry->l4_hash = skb->l4_hash; |
184 | __entry->len = skb->len; | 184 | __entry->len = skb->len; |
185 | __entry->data_len = skb->data_len; | 185 | __entry->data_len = skb->data_len; |
186 | __entry->truesize = skb->truesize; | 186 | __entry->truesize = skb->truesize; |
@@ -191,11 +191,11 @@ DECLARE_EVENT_CLASS(net_dev_rx_verbose_template, | |||
191 | __entry->gso_type = skb_shinfo(skb)->gso_type; | 191 | __entry->gso_type = skb_shinfo(skb)->gso_type; |
192 | ), | 192 | ), |
193 | 193 | ||
194 | TP_printk("dev=%s napi_id=%#x queue_mapping=%u skbaddr=%p vlan_tagged=%d vlan_proto=0x%04x vlan_tci=0x%04x protocol=0x%04x ip_summed=%d rxhash=0x%08x l4_rxhash=%d len=%u data_len=%u truesize=%u mac_header_valid=%d mac_header=%d nr_frags=%d gso_size=%d gso_type=%#x", | 194 | TP_printk("dev=%s napi_id=%#x queue_mapping=%u skbaddr=%p vlan_tagged=%d vlan_proto=0x%04x vlan_tci=0x%04x protocol=0x%04x ip_summed=%d hash=0x%08x l4_hash=%d len=%u data_len=%u truesize=%u mac_header_valid=%d mac_header=%d nr_frags=%d gso_size=%d gso_type=%#x", |
195 | __get_str(name), __entry->napi_id, __entry->queue_mapping, | 195 | __get_str(name), __entry->napi_id, __entry->queue_mapping, |
196 | __entry->skbaddr, __entry->vlan_tagged, __entry->vlan_proto, | 196 | __entry->skbaddr, __entry->vlan_tagged, __entry->vlan_proto, |
197 | __entry->vlan_tci, __entry->protocol, __entry->ip_summed, | 197 | __entry->vlan_tci, __entry->protocol, __entry->ip_summed, |
198 | __entry->rxhash, __entry->l4_rxhash, __entry->len, | 198 | __entry->hash, __entry->l4_hash, __entry->len, |
199 | __entry->data_len, __entry->truesize, | 199 | __entry->data_len, __entry->truesize, |
200 | __entry->mac_header_valid, __entry->mac_header, | 200 | __entry->mac_header_valid, __entry->mac_header, |
201 | __entry->nr_frags, __entry->gso_size, __entry->gso_type) | 201 | __entry->nr_frags, __entry->gso_size, __entry->gso_type) |
diff --git a/net/core/dev.c b/net/core/dev.c index 55f8e64c03a2..48dd323d5918 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2952,7 +2952,7 @@ set_rps_cpu(struct net_device *dev, struct sk_buff *skb, | |||
2952 | flow_table = rcu_dereference(rxqueue->rps_flow_table); | 2952 | flow_table = rcu_dereference(rxqueue->rps_flow_table); |
2953 | if (!flow_table) | 2953 | if (!flow_table) |
2954 | goto out; | 2954 | goto out; |
2955 | flow_id = skb->rxhash & flow_table->mask; | 2955 | flow_id = skb_get_hash(skb) & flow_table->mask; |
2956 | rc = dev->netdev_ops->ndo_rx_flow_steer(dev, skb, | 2956 | rc = dev->netdev_ops->ndo_rx_flow_steer(dev, skb, |
2957 | rxq_index, flow_id); | 2957 | rxq_index, flow_id); |
2958 | if (rc < 0) | 2958 | if (rc < 0) |
@@ -2986,6 +2986,7 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb, | |||
2986 | struct rps_sock_flow_table *sock_flow_table; | 2986 | struct rps_sock_flow_table *sock_flow_table; |
2987 | int cpu = -1; | 2987 | int cpu = -1; |
2988 | u16 tcpu; | 2988 | u16 tcpu; |
2989 | u32 hash; | ||
2989 | 2990 | ||
2990 | if (skb_rx_queue_recorded(skb)) { | 2991 | if (skb_rx_queue_recorded(skb)) { |
2991 | u16 index = skb_get_rx_queue(skb); | 2992 | u16 index = skb_get_rx_queue(skb); |
@@ -3014,7 +3015,8 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb, | |||
3014 | } | 3015 | } |
3015 | 3016 | ||
3016 | skb_reset_network_header(skb); | 3017 | skb_reset_network_header(skb); |
3017 | if (!skb_get_hash(skb)) | 3018 | hash = skb_get_hash(skb); |
3019 | if (!hash) | ||
3018 | goto done; | 3020 | goto done; |
3019 | 3021 | ||
3020 | flow_table = rcu_dereference(rxqueue->rps_flow_table); | 3022 | flow_table = rcu_dereference(rxqueue->rps_flow_table); |
@@ -3023,11 +3025,10 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb, | |||
3023 | u16 next_cpu; | 3025 | u16 next_cpu; |
3024 | struct rps_dev_flow *rflow; | 3026 | struct rps_dev_flow *rflow; |
3025 | 3027 | ||
3026 | rflow = &flow_table->flows[skb->rxhash & flow_table->mask]; | 3028 | rflow = &flow_table->flows[hash & flow_table->mask]; |
3027 | tcpu = rflow->cpu; | 3029 | tcpu = rflow->cpu; |
3028 | 3030 | ||
3029 | next_cpu = sock_flow_table->ents[skb->rxhash & | 3031 | next_cpu = sock_flow_table->ents[hash & sock_flow_table->mask]; |
3030 | sock_flow_table->mask]; | ||
3031 | 3032 | ||
3032 | /* | 3033 | /* |
3033 | * If the desired CPU (where last recvmsg was done) is | 3034 | * If the desired CPU (where last recvmsg was done) is |
@@ -3056,7 +3057,7 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb, | |||
3056 | } | 3057 | } |
3057 | 3058 | ||
3058 | if (map) { | 3059 | if (map) { |
3059 | tcpu = map->cpus[((u64) skb->rxhash * map->len) >> 32]; | 3060 | tcpu = map->cpus[((u64) hash * map->len) >> 32]; |
3060 | 3061 | ||
3061 | if (cpu_online(tcpu)) { | 3062 | if (cpu_online(tcpu)) { |
3062 | cpu = tcpu; | 3063 | cpu = tcpu; |
diff --git a/net/core/filter.c b/net/core/filter.c index ad30d626a5bd..65b75966e206 100644 --- a/net/core/filter.c +++ b/net/core/filter.c | |||
@@ -336,7 +336,7 @@ load_b: | |||
336 | A = skb->dev->type; | 336 | A = skb->dev->type; |
337 | continue; | 337 | continue; |
338 | case BPF_S_ANC_RXHASH: | 338 | case BPF_S_ANC_RXHASH: |
339 | A = skb->rxhash; | 339 | A = skb->hash; |
340 | continue; | 340 | continue; |
341 | case BPF_S_ANC_CPU: | 341 | case BPF_S_ANC_CPU: |
342 | A = raw_smp_processor_id(); | 342 | A = raw_smp_processor_id(); |
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c index 80201bf69d59..107ed12a5323 100644 --- a/net/core/flow_dissector.c +++ b/net/core/flow_dissector.c | |||
@@ -203,8 +203,8 @@ static __always_inline u32 __flow_hash_1word(u32 a) | |||
203 | 203 | ||
204 | /* | 204 | /* |
205 | * __skb_get_hash: calculate a flow hash based on src/dst addresses | 205 | * __skb_get_hash: calculate a flow hash based on src/dst addresses |
206 | * and src/dst port numbers. Sets rxhash in skb to non-zero hash value | 206 | * and src/dst port numbers. Sets hash in skb to non-zero hash value |
207 | * on success, zero indicates no valid hash. Also, sets l4_rxhash in skb | 207 | * on success, zero indicates no valid hash. Also, sets l4_hash in skb |
208 | * if hash is a canonical 4-tuple hash over transport ports. | 208 | * if hash is a canonical 4-tuple hash over transport ports. |
209 | */ | 209 | */ |
210 | void __skb_get_hash(struct sk_buff *skb) | 210 | void __skb_get_hash(struct sk_buff *skb) |
@@ -216,7 +216,7 @@ void __skb_get_hash(struct sk_buff *skb) | |||
216 | return; | 216 | return; |
217 | 217 | ||
218 | if (keys.ports) | 218 | if (keys.ports) |
219 | skb->l4_rxhash = 1; | 219 | skb->l4_hash = 1; |
220 | 220 | ||
221 | /* get a consistent hash (same value on both flow directions) */ | 221 | /* get a consistent hash (same value on both flow directions) */ |
222 | if (((__force u32)keys.dst < (__force u32)keys.src) || | 222 | if (((__force u32)keys.dst < (__force u32)keys.src) || |
@@ -232,7 +232,7 @@ void __skb_get_hash(struct sk_buff *skb) | |||
232 | if (!hash) | 232 | if (!hash) |
233 | hash = 1; | 233 | hash = 1; |
234 | 234 | ||
235 | skb->rxhash = hash; | 235 | skb->hash = hash; |
236 | } | 236 | } |
237 | EXPORT_SYMBOL(__skb_get_hash); | 237 | EXPORT_SYMBOL(__skb_get_hash); |
238 | 238 | ||
@@ -344,7 +344,7 @@ static inline int get_xps_queue(struct net_device *dev, struct sk_buff *skb) | |||
344 | hash = skb->sk->sk_hash; | 344 | hash = skb->sk->sk_hash; |
345 | else | 345 | else |
346 | hash = (__force u16) skb->protocol ^ | 346 | hash = (__force u16) skb->protocol ^ |
347 | skb->rxhash; | 347 | skb->hash; |
348 | hash = __flow_hash_1word(hash); | 348 | hash = __flow_hash_1word(hash); |
349 | queue_index = map->queues[ | 349 | queue_index = map->queues[ |
350 | ((u64)hash * map->len) >> 32]; | 350 | ((u64)hash * map->len) >> 32]; |
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 292304404fda..097a354ec8cd 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -1277,7 +1277,7 @@ static unsigned int fanout_demux_hash(struct packet_fanout *f, | |||
1277 | struct sk_buff *skb, | 1277 | struct sk_buff *skb, |
1278 | unsigned int num) | 1278 | unsigned int num) |
1279 | { | 1279 | { |
1280 | return reciprocal_scale(skb->rxhash, num); | 1280 | return reciprocal_scale(skb_get_hash(skb), num); |
1281 | } | 1281 | } |
1282 | 1282 | ||
1283 | static unsigned int fanout_demux_lb(struct packet_fanout *f, | 1283 | static unsigned int fanout_demux_lb(struct packet_fanout *f, |
@@ -1362,7 +1362,6 @@ static int packet_rcv_fanout(struct sk_buff *skb, struct net_device *dev, | |||
1362 | if (!skb) | 1362 | if (!skb) |
1363 | return 0; | 1363 | return 0; |
1364 | } | 1364 | } |
1365 | skb_get_hash(skb); | ||
1366 | idx = fanout_demux_hash(f, skb, num); | 1365 | idx = fanout_demux_hash(f, skb, num); |
1367 | break; | 1366 | break; |
1368 | case PACKET_FANOUT_LB: | 1367 | case PACKET_FANOUT_LB: |