summaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorTom Herbert <therbert@google.com>2014-07-01 21:33:17 -0700
committerDavid S. Miller <davem@davemloft.net>2014-07-07 21:14:21 -0700
commita3b18ddb9cc1056eea24e3edc1828cfb3fd0726f (patch)
tree5100dd399922df55b29a1acf2b5a4dcc332c10b4 /net/core
parentcb1ce2ef387b01686469487edd45994872d52d73 (diff)
net: Only do flow_dissector hash computation once per packet
Add sw_hash flag to skbuff to indicate that skb->hash was computed from flow_dissector. This flag is checked in skb_get_hash to avoid repeatedly trying to compute the hash (ie. in the case that no L4 hash can be computed). Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/flow_dissector.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index c5f3912dad4c..5f362c1d0332 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -256,6 +256,8 @@ void __skb_get_hash(struct sk_buff *skb)
if (keys.ports)
skb->l4_hash = 1;
+ skb->sw_hash = 1;
+
skb->hash = __flow_hash_from_keys(&keys);
}
EXPORT_SYMBOL(__skb_get_hash);