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 /include | |
| 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>
Diffstat (limited to 'include')
| -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 |
3 files changed, 22 insertions, 22 deletions
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) |
