@@ -276,6 +276,7 @@ static __always_inline u32 __flow_hash_3words(u32 a, u32 b, u32 c)
static inline u32 __flow_hash_from_keys(struct flow_keys *keys)
{
u32 hash;
+ u32 extra;
/* get a consistent hash (same value on both flow directions) */
if (((__force u32)keys->dst < (__force u32)keys->src) ||
@@ -285,7 +286,8 @@ static inline u32 __flow_hash_from_keys(struct flow_keys *keys)
swap(keys->port16[0], keys->port16[1]);
}
- hash = __flow_hash_3words((__force u32)keys->dst,
+ extra = keys->ip_proto;
+ hash = __flow_hash_3words((__force u32)keys->dst ^ extra,
(__force u32)keys->src,
(__force u32)keys->ports);
if (!hash)
Fold ip_proto into dst when computing hash. This provides a more standard 5-tuple hash. Signed-off-by: Tom Herbert <therbert@google.com> --- net/core/flow_dissector.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)