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>
This commit is contained in:

committed by
David S. Miller

parent
4e2e865d95
commit
61b905da33
@@ -444,11 +444,11 @@ static inline u32 skb_mstamp_us_delta(const struct skb_mstamp *t1,
|
||||
* @skb_iif: ifindex of device we arrived on
|
||||
* @tc_index: Traffic control index
|
||||
* @tc_verd: traffic control verdict
|
||||
* @rxhash: the packet hash computed on receive
|
||||
* @hash: the packet hash
|
||||
* @queue_mapping: Queue mapping for multiqueue devices
|
||||
* @ndisc_nodetype: router type (from link layer)
|
||||
* @ooo_okay: allow the mapping of a socket to a queue to be changed
|
||||
* @l4_rxhash: indicate rxhash is a canonical 4-tuple hash over transport
|
||||
* @l4_hash: indicate hash is a canonical 4-tuple hash over transport
|
||||
* ports.
|
||||
* @wifi_acked_valid: wifi_acked was set
|
||||
* @wifi_acked: whether frame was acked on wifi or not
|
||||
@@ -537,7 +537,7 @@ struct sk_buff {
|
||||
|
||||
int skb_iif;
|
||||
|
||||
__u32 rxhash;
|
||||
__u32 hash;
|
||||
|
||||
__be16 vlan_proto;
|
||||
__u16 vlan_tci;
|
||||
@@ -556,7 +556,7 @@ struct sk_buff {
|
||||
#endif
|
||||
__u8 pfmemalloc:1;
|
||||
__u8 ooo_okay:1;
|
||||
__u8 l4_rxhash:1;
|
||||
__u8 l4_hash:1;
|
||||
__u8 wifi_acked_valid:1;
|
||||
__u8 wifi_acked:1;
|
||||
__u8 no_fcs:1;
|
||||
@@ -815,40 +815,40 @@ enum pkt_hash_types {
|
||||
static inline void
|
||||
skb_set_hash(struct sk_buff *skb, __u32 hash, enum pkt_hash_types type)
|
||||
{
|
||||
skb->l4_rxhash = (type == PKT_HASH_TYPE_L4);
|
||||
skb->rxhash = hash;
|
||||
skb->l4_hash = (type == PKT_HASH_TYPE_L4);
|
||||
skb->hash = hash;
|
||||
}
|
||||
|
||||
void __skb_get_hash(struct sk_buff *skb);
|
||||
static inline __u32 skb_get_hash(struct sk_buff *skb)
|
||||
{
|
||||
if (!skb->l4_rxhash)
|
||||
if (!skb->l4_hash)
|
||||
__skb_get_hash(skb);
|
||||
|
||||
return skb->rxhash;
|
||||
return skb->hash;
|
||||
}
|
||||
|
||||
static inline __u32 skb_get_hash_raw(const struct sk_buff *skb)
|
||||
{
|
||||
return skb->rxhash;
|
||||
return skb->hash;
|
||||
}
|
||||
|
||||
static inline void skb_clear_hash(struct sk_buff *skb)
|
||||
{
|
||||
skb->rxhash = 0;
|
||||
skb->l4_rxhash = 0;
|
||||
skb->hash = 0;
|
||||
skb->l4_hash = 0;
|
||||
}
|
||||
|
||||
static inline void skb_clear_hash_if_not_l4(struct sk_buff *skb)
|
||||
{
|
||||
if (!skb->l4_rxhash)
|
||||
if (!skb->l4_hash)
|
||||
skb_clear_hash(skb);
|
||||
}
|
||||
|
||||
static inline void skb_copy_hash(struct sk_buff *to, const struct sk_buff *from)
|
||||
{
|
||||
to->rxhash = from->rxhash;
|
||||
to->l4_rxhash = from->l4_rxhash;
|
||||
to->hash = from->hash;
|
||||
to->l4_hash = from->l4_hash;
|
||||
};
|
||||
|
||||
#ifdef NET_SKBUFF_DATA_USES_OFFSET
|
||||
|
Reference in New Issue
Block a user