[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <46BB2F65.4080602@oracle.com>
Date: Thu, 09 Aug 2007 11:14:45 -0400
From: Chuck Lever <chuck.lever@...cle.com>
To: Aurélien Charbon
<aurelien.charbon@....bull.net>
CC: Mailing list NFSv4 <nfsv4@...ux-nfs.org>,
netdev ML <netdev@...r.kernel.org>, Neil Brown <neilb@...e.de>
Subject: Re: [PATCH 1/1] NFS: change the ip_map cache code to handle IPv6
addresses
Aurélien Charbon wrote:
>>> @@ -112,12 +112,16 @@
>>> return (hash ^ (hash>>8)) & 0xff;
>>> }
>>> #endif
>>> +static inline int hash_ip6(struct in6_addr ip)
>>> +{
>>> + return (hash_ip(ip.s6_addr32[0]) ^ hash_ip(ip.s6_addr32[1])
>>> ^ hash_ip(ip.s6_addr32[2]) ^ hash_ip(ip.s6_addr32[3])) ;
>>> +}
>>
>>
>> How have you tested the effectiveness of the new hash function?
>
> I have not tested that point but I can easily imagine there are better
> solutions.
> Perhaps we can keep the same function for an IPv4 address (only taking
> the 32 bits of IPv4 addr), and then design one for IPv6 addresses.
I see that, to generate the hash, you would be xor-ing the FF and 00
bytes in the canonicalized IPv4 address. Yes, perhaps a better function
is needed, or as you say, one specifically for IPv6 and one for
canonicalized IPv4.
> Do you have any suggestion on that ?
I don't have anything specific, but you may find something useful if you
poke around elsewhere under net/.
View attachment "chuck.lever.vcf" of type "text/x-vcard" (302 bytes)
Powered by blists - more mailing lists