[PATCH 1/1] NFS: change the ip_map cache code to handle IPv6 addresses
Chuck Lever
chuck.lever at oracle.com
Thu Aug 9 11:14:45 EDT 2007
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/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chuck.lever.vcf
Type: text/x-vcard
Size: 301 bytes
Desc: not available
Url : http://linux-nfs.org/pipermail/nfsv4/attachments/20070809/f49f1a2f/attachment.vcf
More information about the NFSv4
mailing list