aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/flow_dissector.c
diff options
context:
space:
mode:
authorTom Herbert <tom@herbertland.com>2015-09-01 12:24:31 -0400
committerDavid S. Miller <davem@davemloft.net>2015-09-01 18:06:23 -0400
commit872b1abb1ed47a691f465fb3d285f6cf6bcd8663 (patch)
tree42d039b2efbd26699c9e2033d54a47d8e831eede /net/core/flow_dissector.c
parent8306b688f1a6621b9efe3b0d827e26750528b12a (diff)
flow_dissector: Add flag to stop parsing when an IPv6 flow label is seen
Add an input flag to flow dissector on rather dissection should be stopped when a flow label is encountered. Presumably, the flow label is derived from a sufficient hash of an inner transport packet so further dissection is not needed (that is ports are not included in the flow hash). Using the flow label instead of ports has the additional benefit that packet fragments should hash to same value as non-fragments for a flow (assuming that the same flow label is used). We set this flag by default in for skb_get_hash. Signed-off-by: Tom Herbert <tom@herbertland.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/flow_dissector.c')
-rw-r--r--net/core/flow_dissector.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 94fd841f341f..094e34354627 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -239,6 +239,8 @@ ipv6:
239 target_container); 239 target_container);
240 key_tags->flow_label = ntohl(flow_label); 240 key_tags->flow_label = ntohl(flow_label);
241 } 241 }
242 if (flags & FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL)
243 goto out_good;
242 } 244 }
243 245
244 if (flags & FLOW_DISSECTOR_F_STOP_AT_L3) 246 if (flags & FLOW_DISSECTOR_F_STOP_AT_L3)
@@ -599,7 +601,8 @@ EXPORT_SYMBOL(flow_hash_from_keys);
599static inline u32 ___skb_get_hash(const struct sk_buff *skb, 601static inline u32 ___skb_get_hash(const struct sk_buff *skb,
600 struct flow_keys *keys, u32 keyval) 602 struct flow_keys *keys, u32 keyval)
601{ 603{
602 if (!skb_flow_dissect_flow_keys(skb, keys, 0)) 604 if (!skb_flow_dissect_flow_keys(skb, keys,
605 FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL))
603 return 0; 606 return 0;
604 607
605 return __flow_hash_from_keys(keys, keyval); 608 return __flow_hash_from_keys(keys, keyval);