Re: [PATCH net-next] ipv6: rename __ipv6_addr_jhash()
From: Hannes Frederic Sowa <hidden>
Date: 2014-08-01 08:47:28
Hi, On Fri, Aug 1, 2014, at 06:56, David Miller wrote:
From: Eric Dumazet <redacted> Date: Wed, 30 Jul 2014 23:38:18 +0200quoted
From: Eric Dumazet <edumazet@google.com> Remove '__' prefix, it has no purpose. Signed-off-by: Eric Dumazet <edumazet@google.com>Actually, I think it does. If you look at where this came from, it's commit: commit b50026b5ac8fe2932e6af0c54b21da0913c4c1c7 Author: Hannes Frederic Sowa [off-list ref] Date: Sat Oct 19 21:48:52 2013 +0200 ipv6: split inet6_ehashfn to hash functions per compilation unit and in that change Hannes uses the convention that __foo() functions take an initval argument for the hash computation where as foo() functions do not. I'm not applying this, sorry :)
The idea was that all the hashing functions (like socket hashing etc.) provide the secret to ipv6_addr_jhash and thus this function should not be called directly but by helper functions. I normally use '__' prefixed function which need a bit more care to handle them correctly (e.g. unlocked versions, argument hiding etc.) and I think this was also the reason I did so at that time. That said, nowadays most hashing functions need (should have) a secret in the network stack and programmers should already know how to deal with that. I don't have a strong opinion on that but would be fine if you apply Eric's patch. Thanks, Hannes