[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1406882847.1781790.147998398.54D3639D@webmail.messagingengine.com>
Date: Fri, 01 Aug 2014 10:47:27 +0200
From: Hannes Frederic Sowa <hannes@...essinduktion.org>
To: David Miller <davem@...emloft.net>, eric.dumazet@...il.com
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH net-next] ipv6: rename __ipv6_addr_jhash()
Hi,
On Fri, Aug 1, 2014, at 06:56, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@...il.com>
> Date: Wed, 30 Jul 2014 23:38:18 +0200
>
> > From: Eric Dumazet <edumazet@...gle.com>
> >
> > Remove '__' prefix, it has no purpose.
> >
> > Signed-off-by: Eric Dumazet <edumazet@...gle.com>
>
> Actually, I think it does.
>
> If you look at where this came from, it's commit:
>
> commit b50026b5ac8fe2932e6af0c54b21da0913c4c1c7
> Author: Hannes Frederic Sowa <hannes@...essinduktion.org>
> 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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists