diff options
author | Tom Herbert <tom@herbertland.com> | 2015-09-01 12:24:25 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-09-01 18:06:22 -0400 |
commit | c6cc1ca7f4d70cbb3ea3a5ca163c5dabaf155cdb (patch) | |
tree | ba007b3db243d74a4dfc2d7dd9d48427b9a19419 /include/net | |
parent | bcc83839ffdb063dd2b0370cd85c4f825761fc59 (diff) |
flowi: Abstract out functions to get flow hash based on flowi
Create __get_hash_from_flowi6 and __get_hash_from_flowi4 to get the
flow keys and hash based on flowi structures. These are called by
__skb_get_hash_flowi6 and __skb_get_hash_flowi4. Also, created
get_hash_from_flowi6 and get_hash_from_flowi4 which can be called
when just the hash value for a flowi is needed.
Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/flow.h | 19 | ||||
-rw-r--r-- | include/net/flow_dissector.h | 2 |
2 files changed, 21 insertions, 0 deletions
diff --git a/include/net/flow.h b/include/net/flow.h index 9e0297c4c11d..dafe97c3c048 100644 --- a/include/net/flow.h +++ b/include/net/flow.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/socket.h> | 10 | #include <linux/socket.h> |
11 | #include <linux/in6.h> | 11 | #include <linux/in6.h> |
12 | #include <linux/atomic.h> | 12 | #include <linux/atomic.h> |
13 | #include <net/flow_dissector.h> | ||
13 | 14 | ||
14 | /* | 15 | /* |
15 | * ifindex generation is per-net namespace, and loopback is | 16 | * ifindex generation is per-net namespace, and loopback is |
@@ -243,4 +244,22 @@ void flow_cache_flush(struct net *net); | |||
243 | void flow_cache_flush_deferred(struct net *net); | 244 | void flow_cache_flush_deferred(struct net *net); |
244 | extern atomic_t flow_cache_genid; | 245 | extern atomic_t flow_cache_genid; |
245 | 246 | ||
247 | __u32 __get_hash_from_flowi6(struct flowi6 *fl6, struct flow_keys *keys); | ||
248 | |||
249 | static inline __u32 get_hash_from_flowi6(struct flowi6 *fl6) | ||
250 | { | ||
251 | struct flow_keys keys; | ||
252 | |||
253 | return __get_hash_from_flowi6(fl6, &keys); | ||
254 | } | ||
255 | |||
256 | __u32 __get_hash_from_flowi4(struct flowi4 *fl4, struct flow_keys *keys); | ||
257 | |||
258 | static inline __u32 get_hash_from_flowi4(struct flowi4 *fl4) | ||
259 | { | ||
260 | struct flow_keys keys; | ||
261 | |||
262 | return __get_hash_from_flowi4(fl4, &keys); | ||
263 | } | ||
264 | |||
246 | #endif | 265 | #endif |
diff --git a/include/net/flow_dissector.h b/include/net/flow_dissector.h index af76c496f7db..74fe160f0b05 100644 --- a/include/net/flow_dissector.h +++ b/include/net/flow_dissector.h | |||
@@ -172,4 +172,6 @@ static inline bool flow_keys_have_l4(struct flow_keys *keys) | |||
172 | return (keys->ports.ports || keys->tags.flow_label); | 172 | return (keys->ports.ports || keys->tags.flow_label); |
173 | } | 173 | } |
174 | 174 | ||
175 | u32 flow_hash_from_keys(struct flow_keys *keys); | ||
176 | |||
175 | #endif | 177 | #endif |