summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorTom Herbert <tom@herbertland.com>2015-06-04 09:16:44 -0700
committerDavid S. Miller <davem@davemloft.net>2015-06-04 15:44:31 -0700
commit87ee9e52ffeb168803a76cc07734425227cc2268 (patch)
tree2bfbfdd9de14ba920231bcab9eb6efe46a509966 /net/core
parentd34af823ff401c312541aa613c49ea4b872bde9e (diff)
downloadlinux-87ee9e52ffeb168803a76cc07734425227cc2268.tar.gz
linux-87ee9e52ffeb168803a76cc07734425227cc2268.tar.bz2
linux-87ee9e52ffeb168803a76cc07734425227cc2268.zip
net: Add IPv6 flow label to flow_keys
In flow_dissector set the flow label in flow_keys for IPv6. This also removes the shortcircuiting of flow dissection when a non-zero label is present, the flow label can be considered to provide additional entropy for a hash. Signed-off-by: Tom Herbert <tom@herbertland.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/flow_dissector.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 5c66cb2e66df..70f0567b6be9 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -210,30 +210,17 @@ ipv6:
memcpy(key_ipv6_addrs, &iph->saddr, sizeof(*key_ipv6_addrs));
key_control->addr_type = FLOW_DISSECTOR_KEY_IPV6_ADDRS;
- goto flow_label;
}
- break;
-flow_label:
+
flow_label = ip6_flowlabel(iph);
if (flow_label) {
- /* Awesome, IPv6 packet has a flow label so we can
- * use that to represent the ports without any
- * further dissection.
- */
-
- key_basic->n_proto = proto;
- key_basic->ip_proto = ip_proto;
- key_control->thoff = (u16)nhoff;
-
if (skb_flow_dissector_uses_key(flow_dissector,
- FLOW_DISSECTOR_KEY_PORTS)) {
- key_ports = skb_flow_dissector_target(flow_dissector,
- FLOW_DISSECTOR_KEY_PORTS,
- target_container);
- key_ports->ports = flow_label;
+ FLOW_DISSECTOR_KEY_FLOW_LABEL)) {
+ key_tags = skb_flow_dissector_target(flow_dissector,
+ FLOW_DISSECTOR_KEY_FLOW_LABEL,
+ target_container);
+ key_tags->flow_label = ntohl(flow_label);
}
-
- return true;
}
break;
@@ -659,6 +646,10 @@ static const struct flow_dissector_key flow_keys_dissector_keys[] = {
.key_id = FLOW_DISSECTOR_KEY_VLANID,
.offset = offsetof(struct flow_keys, tags),
},
+ {
+ .key_id = FLOW_DISSECTOR_KEY_FLOW_LABEL,
+ .offset = offsetof(struct flow_keys, tags),
+ },
};
static const struct flow_dissector_key flow_keys_buf_dissector_keys[] = {