Thread (7 messages) flat view 7 messages, 4 authors, 2016-07-04

Re: [PATCH] packet: Use symmetric hash for PACKET_FANOUT_HASH.

From: Hannes Frederic Sowa <hidden>
Date: 2016-07-04 09:29:36

On 01.07.2016 22:08, David Miller wrote:
People who use PACKET_FANOUT_HASH want a symmetric hash, meaning that
they want packets going in both directions on a flow to hash to the
same bucket.

The core kernel SKB hash became non-symmetric when the ipv6 flow label
and other entities were incorporated into the standard flow hash order
to increase entropy.

But there are no users of PACKET_FANOUT_HASH who want an assymetric
hash, they all want a symmetric one.

Therefore, use the flow dissector to compute a flat symmetric hash
over only the protocol, addresses and ports.  This hash does not get
installed into and override the normal skb hash, so this change has
no effect whatsoever on the rest of the stack.

Reported-by: Eric Leblond <redacted>
Tested-by: Eric Leblond <redacted>
Signed-off-by: David S. Miller <davem@davemloft.net>
---

I'll be pushing this to -stable branches as well.
Acked-by: Hannes Frederic Sowa <redacted>

Actually a funny trick I learned from DragonflyBSD sources is to just
randomize the first two bytes of the rss key and replicate them to fill
up the the last 38 bytes (or more). Doing so makes the rss hash
generation on the networking card symmetric [1].

Bye,
Hannes

[1]
http://gitweb.dragonflybsd.org/dragonfly.git/blob/HEAD:/sys/net/toeplitz.c#l41
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help