aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorTom Herbert <therbert@google.com>2014-07-02 00:33:17 -0400
committerDavid S. Miller <davem@davemloft.net>2014-07-08 00:14:21 -0400
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)
256 if (keys.ports) 256 if (keys.ports)
257 skb->l4_hash = 1; 257 skb->l4_hash = 1;
258 258
259 skb->sw_hash = 1;
260
259 skb->hash = __flow_hash_from_keys(&keys); 261 skb->hash = __flow_hash_from_keys(&keys);
260} 262}
261EXPORT_SYMBOL(__skb_get_hash); 263EXPORT_SYMBOL(__skb_get_hash);