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 | |||
